:root {
  color-scheme: light;
  --blue-950: #102a56;
  --blue-900: #16366d;
  --blue-800: #1d4d91;
  --blue-700: #2563b7;
  --blue-600: #2f76d2;
  --blue-500: #4a8be0;
  --blue-100: #ddebff;
  --blue-50: #f2f7ff;
  --ink: #14213a;
  --muted: #66738a;
  --line: #dce5f2;
  --surface: #ffffff;
  --canvas: #f5f8fc;
  --answer: #f1f7ff;
  --success: #167763;
  --danger: #b63b4b;
  --shadow-sm: 0 4px 14px rgba(31, 64, 112, .07);
  --shadow-md: 0 18px 50px rgba(31, 64, 112, .12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 82% 5%, rgba(111, 166, 235, .16), transparent 30rem),
    linear-gradient(180deg, #f7faff 0, var(--canvas) 28rem);
}

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

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(47, 118, 210, .3);
  outline-offset: 2px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 26px 18px 20px;
  color: #fff;
  background:
    radial-gradient(circle at 0 0, rgba(99, 156, 234, .42), transparent 18rem),
    linear-gradient(165deg, var(--blue-900), #0e244b 72%);
  overflow: hidden;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 8px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .14);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-weight: 800;
  letter-spacing: -.03em;
  background: linear-gradient(145deg, #78aff3, #4b82d7);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 8px 24px rgba(0,0,0,.18);
}

.brand-copy { display: grid; gap: 2px; }
.brand-copy strong { font-size: 15px; letter-spacing: .01em; }
.brand-copy span { color: rgba(255,255,255,.66); font-size: 12px; }

.sidebar-label {
  padding: 22px 10px 10px;
  color: rgba(255,255,255,.55);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.topic-list {
  display: grid;
  gap: 4px;
  padding-right: 4px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.24) transparent;
}

.topic-nav-button {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 10px;
  border: 0;
  border-radius: 11px;
  color: rgba(255,255,255,.72);
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.topic-nav-button:hover {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.topic-nav-button.is-active {
  color: #fff;
  background: linear-gradient(90deg, rgba(92, 151, 230, .42), rgba(92, 151, 230, .14));
  box-shadow: inset 3px 0 0 #8ec0ff;
}

.topic-nav-button .nav-index {
  color: rgba(255,255,255,.44);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.topic-nav-button .nav-title {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-nav-button .nav-count {
  min-width: 25px;
  padding: 3px 6px;
  border-radius: 999px;
  color: rgba(255,255,255,.7);
  background: rgba(255,255,255,.09);
  font-size: 10px;
  text-align: center;
}

.sidebar-tip {
  display: flex;
  gap: 9px;
  margin-top: 16px;
  padding: 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 13px;
  color: rgba(255,255,255,.66);
  background: rgba(255,255,255,.05);
  font-size: 11px;
  line-height: 1.55;
}

.sidebar-tip p { margin: 0; }
.tip-icon { color: #8fc1ff; font-size: 18px; }

.main-content {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 42px 0 80px;
}

.topbar .eyebrow,
.topic-number {
  color: var(--blue-600);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .15em;
}

.topbar h1 {
  margin: 7px 0 7px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.1;
  letter-spacing: -.045em;
}

.topbar p { margin: 0; color: var(--muted); font-size: 15px; }

.control-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 28px 0 22px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-width: 0;
}

.search-box svg {
  position: absolute;
  left: 15px;
  width: 19px;
  fill: none;
  stroke: #7a899f;
  stroke-linecap: round;
  stroke-width: 1.8;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  height: 48px;
  padding: 0 76px 0 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
}

.search-box input::placeholder { color: #9aa6b7; }

.search-box kbd {
  position: absolute;
  right: 11px;
  padding: 4px 7px;
  border: 1px solid #dbe3ee;
  border-bottom-width: 2px;
  border-radius: 6px;
  color: #8793a6;
  background: #f7f9fc;
  font-family: inherit;
  font-size: 10px;
}

.secondary-button,
.mobile-topic-select {
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow-sm);
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 17px;
  color: var(--blue-800);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.secondary-button:hover { border-color: #bbd0ec; background: var(--blue-50); }
.mobile-topic-select { display: none; padding: 0 38px 0 13px; color: var(--ink); }

.topic-hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
  border: 1px solid rgba(37,99,183,.1);
  border-radius: var(--radius-lg);
  color: #fff;
  background:
    radial-gradient(circle at 88% 10%, rgba(148, 195, 255, .3), transparent 15rem),
    linear-gradient(135deg, var(--blue-900), var(--blue-700));
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.topic-hero::after {
  content: "";
  position: absolute;
  right: -44px;
  bottom: -74px;
  width: 180px;
  height: 180px;
  border: 28px solid rgba(255,255,255,.055);
  border-radius: 50%;
}

.topic-hero .topic-number { color: #a9ceff; }
.topic-hero h2 { margin: 6px 0 4px; font-size: clamp(24px, 3vw, 34px); letter-spacing: -.03em; }
.topic-hero p { margin: 0; color: rgba(255,255,255,.7); font-size: 14px; }

.topic-stats {
  position: relative;
  z-index: 1;
  min-width: 112px;
  padding: 13px 17px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 16px;
  background: rgba(255,255,255,.09);
  backdrop-filter: blur(8px);
  text-align: center;
}

.topic-stats strong { display: block; font-size: 27px; line-height: 1; }
.topic-stats span { display: block; margin-top: 5px; color: rgba(255,255,255,.68); font-size: 11px; }

.question-list { display: grid; gap: 15px; margin-top: 20px; }

.search-group { display: grid; gap: 14px; }
.search-group + .search-group { margin-top: 10px; }
.search-group-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 12px 2px -2px;
  color: var(--blue-900);
  font-size: 17px;
}
.search-group-title span { color: var(--muted); font-size: 12px; font-weight: 500; }

.question-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.question-card:hover { border-color: #c8d8ed; box-shadow: 0 10px 30px rgba(31,64,112,.1); }

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px 0;
}

.question-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .09em;
}

.question-label .number-badge {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  color: #fff;
  background: var(--blue-700);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.result-topic-badge {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--muted);
  background: #f1f4f8;
  font-size: 10px;
  font-weight: 700;
}

.speech-block {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  width: calc(100% - 28px);
  margin: 6px 14px 14px;
  padding: 14px 14px 14px 16px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.speech-block:hover { border-color: #d9e7f8; background: var(--blue-50); }
.speech-block:active { transform: translateY(1px); }
.speech-block.is-playing { border-color: #9fc2ef; background: #eaf3ff; }
.speech-copy { min-width: 0; }
.english-text { display: block; font-size: 16px; font-weight: 680; line-height: 1.55; letter-spacing: -.01em; }
.chinese-text { display: block; margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.6; }

.play-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: center;
  min-width: 70px;
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--blue-700);
  background: #eef5ff;
  font-size: 11px;
  font-weight: 800;
  justify-content: center;
}

.is-playing .play-chip { color: #fff; background: var(--blue-700); }
.play-symbol { width: 14px; text-align: center; }

.answer-toggle-row {
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: 1px solid #edf1f6;
}

.answer-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: -1px 0 0;
  padding: 10px 16px;
  border: 0;
  border-radius: 0 0 10px 10px;
  color: var(--blue-700);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.answer-toggle:hover { background: var(--blue-50); }
.chevron { display: inline-block; transition: transform .18s ease; }
.answer-toggle[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.answer-panel {
  padding: 13px 14px 2px;
  border-top: 1px solid #dfeafa;
  background: var(--answer);
}

.answer-panel[hidden] { display: none; }
.answer-panel .answer-heading { margin: 0 16px 3px; color: var(--success); font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.answer-panel .speech-block { margin-bottom: 12px; background: rgba(255,255,255,.62); }
.answer-panel .speech-block:hover { border-color: #b9d4f4; background: #fff; }

.empty-state {
  padding: 72px 24px;
  color: var(--muted);
  text-align: center;
}
.empty-state div { color: var(--blue-500); font-size: 42px; }
.empty-state h2 { margin: 8px 0 4px; color: var(--ink); font-size: 20px; }
.empty-state p { margin: 0; font-size: 13px; }

.audio-status {
  position: fixed;
  z-index: 20;
  right: 22px;
  bottom: 22px;
  max-width: min(360px, calc(100vw - 44px));
  padding: 12px 16px;
  border-radius: 12px;
  color: #fff;
  background: var(--blue-900);
  box-shadow: var(--shadow-md);
  font-size: 12px;
}
.audio-status.is-error { background: var(--danger); }

@media (max-width: 980px) {
  .app-shell { display: block; }
  .sidebar { display: none; }
  .main-content { width: min(100% - 32px, 820px); padding-top: 28px; }
  .mobile-topic-select { display: block; max-width: 230px; }
  .control-panel { flex-wrap: wrap; }
  .search-box { flex-basis: 100%; order: -1; }
}

@media (max-width: 620px) {
  .main-content { width: min(100% - 22px, 620px); padding: 22px 0 56px; }
  .topbar h1 { font-size: 30px; }
  .topbar p { max-width: 32ch; font-size: 13px; line-height: 1.6; }
  .control-panel { gap: 9px; margin-top: 22px; }
  .mobile-topic-select, .secondary-button { flex: 1; min-width: 0; padding-left: 11px; padding-right: 11px; }
  .topic-hero { padding: 22px 20px; border-radius: 19px; }
  .topic-hero h2 { font-size: 25px; }
  .topic-stats { min-width: 88px; padding: 11px; }
  .card-topline { padding-left: 14px; padding-right: 14px; }
  .speech-block { grid-template-columns: 1fr; gap: 11px; padding: 12px; }
  .play-chip { justify-self: start; }
  .english-text { font-size: 15px; }
  .chinese-text { font-size: 12px; }
  .search-box kbd { display: none; }
  .search-box input { padding-right: 14px; }
}

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

/* Phrase practice and word lookup */
.word-token {
  position: relative;
  border-radius: 4px;
  text-decoration: underline;
  text-decoration-color: rgba(47, 118, 210, .28);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: pan-y;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.word-token.is-long-pressing {
  color: var(--blue-800);
  background: #cfe4ff;
  box-shadow: 0 0 0 4px #cfe4ff;
}

.answer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 14px 10px;
}

.answer-panel .answer-heading {
  margin: 0;
}

.full-answer-button {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
}

.full-answer-button .play-chip {
  min-width: 96px;
  border: 1px solid #c8dbf2;
  background: #fff;
}

.full-answer-button:hover .play-chip,
.full-answer-button.is-playing .play-chip {
  border-color: #8fb7ea;
  background: #e5f1ff;
}

.answer-practice {
  margin: 0 0 12px;
  padding: 16px;
  border: 1px solid #d8e7f8;
  border-radius: 14px;
  background: rgba(255, 255, 255, .76);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}

.answer-rich {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 670;
  line-height: 2.05;
  letter-spacing: -.008em;
}

.phrase-segment {
  display: inline;
  margin: 0;
  padding: 1px 2px 2px;
  border: 0;
  border-bottom: 1px dashed rgba(37, 99, 183, .42);
  border-radius: 6px;
  color: inherit;
  background: rgba(221, 235, 255, .2);
  font: inherit;
  line-height: inherit;
  text-align: left;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: color .16s ease, background .16s ease, box-shadow .16s ease;
}

.phrase-segment:hover {
  color: var(--blue-900);
  background: #dcecff;
}

.phrase-segment:active {
  background: #cbe2ff;
}

.phrase-segment.is-playing {
  color: #0f4f9d;
  background: #c7e0ff;
  box-shadow: 0 0 0 2px rgba(74, 139, 224, .2);
}

.answer-translation {
  margin: 12px 2px 0;
  padding-top: 11px;
  border-top: 1px solid #e1eaf5;
}

.word-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(12, 30, 59, .36);
  opacity: 0;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  transition: opacity .16s ease;
}

.word-backdrop.is-visible { opacity: 1; }
.word-backdrop[hidden], .word-sheet[hidden] { display: none; }

.word-sheet {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 51;
  width: min(480px, calc(100% - 32px));
  padding: 26px 28px 28px;
  padding-bottom: max(28px, calc(18px + env(safe-area-inset-bottom)));
  border: 1px solid rgba(201, 219, 242, .9);
  border-radius: 24px;
  color: var(--ink);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 26px 80px rgba(10, 34, 74, .28);
  opacity: 0;
  transform: translate(-50%, 18px) scale(.98);
  transition: opacity .16s ease, transform .16s ease;
}

.word-sheet.is-visible {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

.word-sheet-handle {
  display: none;
  width: 42px;
  height: 5px;
  margin: -12px auto 18px;
  border-radius: 999px;
  background: #d6deea;
}

.word-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  color: var(--muted);
  background: #edf3fa;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.word-kicker {
  color: var(--blue-600);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .13em;
}

.word-title-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 7px;
}

.word-title-row h2 {
  margin: 0;
  color: var(--blue-950);
  font-size: 34px;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.word-pos {
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--blue-700);
  background: var(--blue-50);
  font-size: 12px;
  font-weight: 750;
}

.word-lemma {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.word-ipa {
  margin: 8px 0 0;
  color: #4b5d78;
  font-family: "Segoe UI", "Arial Unicode MS", sans-serif;
  font-size: 18px;
  letter-spacing: .015em;
}

.word-zh {
  margin: 16px 0 18px;
  font-size: 18px;
  font-weight: 720;
  line-height: 1.5;
}

.word-replay {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 132px;
  padding: 10px 16px;
  border: 1px solid #a8c8ef;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--blue-700), var(--blue-600));
  box-shadow: 0 8px 20px rgba(37, 99, 183, .18);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.word-replay.is-playing { background: linear-gradient(135deg, #194f93, #2868b9); }

@media (hover: none) {
  .phrase-segment:hover { color: inherit; background: rgba(221, 235, 255, .2); }
}

@media (max-width: 620px) {
  .answer-header { align-items: flex-start; margin: 0 2px 10px; }
  .answer-panel .answer-heading { padding-top: 8px; line-height: 1.5; }
  .answer-practice { padding: 14px 12px; }
  .answer-rich { font-size: 15px; line-height: 2.15; }
  .phrase-segment { padding-left: 3px; padding-right: 3px; }
  .word-sheet {
    bottom: 0;
    width: 100%;
    padding: 24px 22px 24px;
    padding-bottom: max(24px, calc(16px + env(safe-area-inset-bottom)));
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 25px 25px 0 0;
    transform: translate(-50%, 28px);
  }
  .word-sheet.is-visible { transform: translate(-50%, 0); }
  .word-sheet-handle { display: block; }
  .word-title-row h2 { font-size: 31px; }
  .word-replay { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .word-token,
  .phrase-segment,
  .word-backdrop,
  .word-sheet { transition: none !important; }
}

/* Reusable Part 1 corpus */
.corpus-page {
  --success: #0b7b72;
  --answer: #f0f8f8;
}

.corpus-topbar p { max-width: 760px; line-height: 1.7; }

.corpus-hero {
  min-height: 166px;
  align-items: center;
  background:
    radial-gradient(circle at 92% 20%, rgba(77, 209, 190, .2), transparent 17rem),
    linear-gradient(120deg, #173d78, #2462aa 72%, #278a99);
}

.corpus-hero > div:first-child { max-width: min(760px, calc(100% - 150px)); }

.topic-hero .category-description {
  max-width: 700px;
  margin-top: 10px;
  color: rgba(255, 255, 255, .84);
  font-size: 13px;
  line-height: 1.65;
}

.corpus-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px 3px;
}

.corpus-card-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.corpus-card-meta .question-number {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  flex: 0 0 auto;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(145deg, var(--blue-700), #268b91);
  font-size: 11px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.corpus-card-meta .section-label {
  color: var(--blue-700);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .1em;
}

.corpus-source-tag {
  max-width: 250px;
  padding: 5px 9px;
  overflow: hidden;
  border-radius: 999px;
  color: #467068;
  background: #eaf7f4;
  font-size: 10px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.corpus-line-section { padding: 9px 16px 15px; }

.corpus-line-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 9px;
}

.corpus-line-toolbar .answer-heading {
  margin: 0;
  color: var(--success);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .12em;
}

.corpus-practice {
  margin: 0;
  padding: 15px 16px;
  border-color: #d9e8ef;
  background: linear-gradient(150deg, rgba(255,255,255,.96), rgba(244,250,251,.9));
}

.corpus-rich-line { line-height: 2.1; }

.corpus-toggle-row { background: #fbfdff; }

.corpus-context {
  padding: 14px 16px 4px;
  border-top-color: #d5ebe7;
  background: linear-gradient(180deg, #eef8f7, #f4f9ff);
}

.corpus-context-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 3px 9px;
}

.corpus-context .corpus-context-head .answer-heading {
  margin: 0;
  color: var(--success);
}

.corpus-context-head > span {
  padding: 4px 8px;
  border-radius: 999px;
  color: #54716e;
  background: rgba(255,255,255,.78);
  font-size: 10px;
  font-weight: 700;
}

.corpus-source-question {
  width: 100%;
  margin: 0 0 10px;
  border-color: rgba(113, 171, 161, .22);
  background: rgba(255,255,255,.72);
}

.corpus-example { padding: 2px 0 0; }
.corpus-example .corpus-practice { background: rgba(255,255,255,.78); }
.corpus-example .corpus-line-toolbar { margin-right: 2px; margin-left: 2px; }

.corpus-full-button .play-chip { min-width: 90px; }

.corpus-list .search-group { display: grid; gap: 16px; }
.corpus-list .search-group-title { margin-top: 18px; }

@media (max-width: 780px) {
  .corpus-hero > div:first-child { max-width: calc(100% - 105px); }
  .topic-hero .category-description { max-width: 560px; }
}

@media (max-width: 620px) {
  .corpus-hero { min-height: 150px; }
  .corpus-hero > div:first-child { max-width: calc(100% - 82px); }
  .topic-hero .category-description {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
  .corpus-card-top { padding: 12px 14px 2px; }
  .corpus-source-tag { max-width: 150px; }
  .corpus-line-section { padding: 9px 12px 13px; }
  .corpus-line-toolbar { align-items: flex-start; }
  .corpus-line-toolbar .answer-heading { padding-top: 8px; line-height: 1.45; }
  .corpus-context { padding-right: 12px; padding-left: 12px; }
  .corpus-context-head { align-items: flex-start; }
}

.library-switch {
  display: inline-flex;
  gap: 4px;
  margin-top: 15px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--shadow-sm);
}

.library-switch a {
  min-width: 78px;
  padding: 7px 13px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.library-switch a:hover { color: var(--blue-800); background: var(--blue-50); }
.library-switch a.is-active { color: #fff; background: var(--blue-700); }

.accent-control {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.accent-control > span {
  padding: 0 7px 0 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.accent-control button {
  height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 10px;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 760;
  cursor: pointer;
}

.accent-control button:hover { color: var(--blue-800); background: var(--blue-50); }
.accent-control button.is-active { color: #fff; background: var(--blue-700); box-shadow: 0 4px 10px rgba(37, 99, 183, .18); }

.word-ipa.is-accent-label {
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--blue-800);
  background: var(--blue-50);
  font-family: inherit;
  font-size: 12px;
  font-weight: 760;
}

@media (max-width: 620px) {
  .accent-control { flex: 1; justify-content: center; min-width: 176px; }
  .library-switch { width: 100%; }
  .library-switch a { flex: 1; }
}
