:root {
  --bg: #eef1f5;
  --surface: #ffffff;
  --surface-soft: #f5f2fb;
  --text: #25252b;
  --muted: #777782;
  --line: #dedee5;
  --brand: #6a0097;
  --brand-dark: #12003f;
  --brand-soft: #ead8f2;
  --accent: #9f00d6;
  --warning: #c92b27;
  --shadow: 0 10px 26px rgba(20, 20, 30, 0.12);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

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

button,
input,
select {
  font: inherit;
}

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

.sidebar-collapsed .app-shell {
  grid-template-columns: 0 minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.sidebar-collapsed .sidebar {
  opacity: 0;
  pointer-events: none;
  overflow: hidden;
}

.sidebar-close {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  min-height: 78px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}

.brand img {
  width: 230px;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  object-position: left center;
}

.nav {
  display: grid;
  gap: 0;
  padding-top: 0;
}

.nav a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 22px;
  border-radius: 0;
  color: var(--text);
  font-weight: 700;
}

.nav a:hover {
  background: var(--brand-soft);
  color: var(--brand);
}

.nav small {
  color: var(--muted);
}

.page {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 72px;
  padding: 14px 32px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 4px 14px rgba(25, 25, 40, 0.12);
}

.menu-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 8px 11px;
  color: var(--brand);
  font-weight: 800;
}

.search-wrap {
  position: relative;
  flex: 0 1 440px;
}

.search-wrap input {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 0 16px;
  color: var(--text);
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(106, 0, 151, 0.12);
}

.search-button {
  min-height: 42px;
  border: 1px solid var(--brand);
  border-radius: var(--radius);
  background: var(--brand);
  color: #fff;
  padding: 0 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(106, 0, 151, 0.24);
}

.search-suggestions {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 30;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.suggestion-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.suggestion-item:last-child {
  border-bottom: 0;
}

.suggestion-item:hover,
.suggestion-item.is-highlighted {
  background: #fbf7fd;
}

.suggestion-item span {
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.suggestion-item strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggestion-item small {
  color: var(--muted);
}

.suggestion-empty {
  padding: 14px;
  color: var(--muted);
}

.lesson-tabs {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  overflow-x: auto;
  max-width: min(760px, 48vw);
  padding-bottom: 2px;
  scrollbar-width: none;
}

.lesson-tabs::-webkit-scrollbar {
  display: none;
}

.lesson-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.lesson-tab:hover,
.lesson-tab.is-active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.lesson-tab.all-lessons {
  min-width: max-content;
  padding: 0 12px;
}

.main {
  width: min(1320px, calc(100vw - 340px));
  margin: 0 auto;
  padding: 34px 28px 56px;
}

.sidebar-collapsed .main {
  width: min(1460px, calc(100vw - 56px));
}

.hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 24px;
  align-items: end;
  padding: 34px;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-band h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.3rem);
  line-height: 1.03;
  color: var(--brand);
}

.hero-band p {
  max-width: 760px;
  color: var(--muted);
}

.hero-panel {
  display: grid;
  gap: 4px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-panel strong {
  font-size: 2.2rem;
  color: var(--brand);
}

.metric-label,
.eyebrow {
  margin: 0 0 6px;
  color: var(--brand);
  font-size: 0.77rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 22px 0 34px;
}

.stat-card,
.content-card,
.empty-state,
.detail,
.filters {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.stat-card {
  padding: 18px;
  box-shadow: 0 2px 8px rgba(20, 20, 30, 0.06);
}

.stat-card span {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.75rem;
  color: var(--text);
}

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

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

.section-heading h2 {
  margin: 0;
  font-size: 1.45rem;
}

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

.card-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.content-card {
  position: relative;
  display: flex;
  min-height: 250px;
  flex-direction: column;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(20, 20, 30, 0.06);
  cursor: pointer;
}

.content-card:hover {
  border-color: rgba(106, 0, 151, 0.45);
  box-shadow: var(--shadow);
}

.content-card h3 {
  margin: 14px 0 8px;
  font-size: 1.05rem;
  line-height: 1.25;
}

.content-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}

.content-card p {
  margin: 0;
  color: var(--muted);
}

.card-topline,
.meta-row,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.meta-row {
  margin-top: auto;
  padding-top: 16px;
  color: var(--muted);
  font-size: 0.85rem;
}

.section-preview {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
}

.section-preview li + li {
  margin-top: 4px;
}

.tag-row {
  margin-top: 12px;
}

.tag-row span,
.chip,
.type-badge,
.difficulty,
.lesson-number {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 700;
}

.lesson-number {
  background: var(--brand);
  color: #fff;
}

.tag-row span,
.chip {
  border: 1px solid var(--line);
  background: #f7faf9;
  color: var(--muted);
}

.chip {
  cursor: pointer;
}

.chip.is-active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.type-badge {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.difficulty {
  background: #eef2f5;
  color: #465762;
}

.difficulty.intermediate {
  background: #f6e5fb;
  color: var(--accent);
}

.difficulty.advanced {
  background: #f8eeee;
  color: var(--warning);
}

.completed-label {
  position: absolute;
  right: 14px;
  bottom: 14px;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 800;
}

.content-card.is-complete {
  background: linear-gradient(180deg, #ffffff 0%, #fbf5ff 100%);
}

.filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr)) minmax(220px, 2fr);
  gap: 14px;
  padding: 16px;
  margin-bottom: 16px;
}

.filters label,
.tag-filter {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.filters select {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 0 10px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.result-meta {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 700;
}

.active-search {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border: 1px solid var(--brand-soft);
  border-radius: var(--radius);
  background: #fbf7fd;
  padding: 10px 12px;
  color: var(--muted);
}

.active-search strong {
  color: var(--brand);
}

.active-search button {
  border: 0;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
  font-weight: 800;
}

.empty-state {
  padding: 34px;
  text-align: center;
  color: var(--muted);
}

.empty-state h1,
.empty-state h3 {
  color: var(--text);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  border: 1px solid var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 8px rgba(106, 0, 151, 0.28);
}

.secondary-button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--brand);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.breadcrumbs a {
  color: var(--brand);
  font-weight: 700;
}

.detail {
  overflow: hidden;
}

.detail-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.detail-header h1 {
  margin: 0;
  font-size: clamp(1.9rem, 3vw, 2.8rem);
  line-height: 1.08;
}

.detail-header p {
  max-width: 760px;
  color: var(--muted);
}

.detail-actions {
  display: flex;
  align-items: start;
  gap: 10px;
}

.media-frame,
.reader-frame,
.article-body {
  padding: 20px;
  background: #fff;
}

.lesson-layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 0;
  background: #fff;
}

.lesson-outline {
  border-right: 1px solid var(--line);
  background: #faf9fc;
  padding: 22px;
  position: sticky;
  top: 92px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow: auto;
}

.lesson-outline h2 {
  margin: 0 0 14px;
  font-size: 1.05rem;
}

.lesson-outline ol {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--muted);
}

.lesson-outline li + li {
  margin-top: 8px;
}

.outline-link {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  margin: 0 0 12px;
  border: 1px solid var(--brand-soft);
  border-radius: var(--radius);
  background: #fff;
  color: var(--brand);
  font-weight: 900;
  padding: 0 12px;
  text-align: center;
}

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

.full-width {
  width: 100%;
}

.lesson-outline .secondary-button {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  text-align: center;
}

.outline-note {
  display: grid;
  gap: 5px;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius);
  background: #fff;
  color: var(--muted);
  font-size: 0.88rem;
}

.outline-note strong {
  color: var(--brand);
}

.lesson-videos {
  padding: 22px 22px 34px;
}

.compact-heading {
  margin-bottom: 12px;
}

.video-list {
  display: grid;
  gap: 14px;
}

.video-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.72fr) minmax(280px, 1fr);
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  background: #fff;
}

.video-panel h3 {
  margin: 0 0 6px;
}

.video-panel p {
  margin: 0 0 8px;
  color: var(--muted);
}

.video-panel span {
  color: var(--brand);
  font-weight: 800;
}

.video-panel video {
  display: block;
  width: 100%;
  max-height: 360px;
  border-radius: var(--radius);
  background: #000;
}

.document-section {
  padding: 34px 22px 22px;
  border-top: 12px solid #eef1f5;
  background: #f4f6f9;
}

.document-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.document-toolbar h2 {
  margin: 0;
}

.media-frame video {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: var(--radius);
  background: #000;
}

.reader-frame object {
  display: block;
  width: 100%;
  height: 92vh;
  min-height: 92vh;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef1f5;
}

.pdf-fallback {
  display: grid;
  place-items: center;
  gap: 14px;
  min-height: 360px;
  color: var(--muted);
}

.learning-check {
  margin: 0;
  padding: 30px;
  border-top: 12px solid #eef1f5;
  background: #fff;
  scroll-margin-top: 96px;
}

.learning-check-shell {
  max-width: 1040px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 6px 18px rgba(20, 20, 30, 0.06);
  overflow: hidden;
}

.learning-check-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 0;
  background: #fff;
  color: var(--text);
  padding: 20px 22px;
  cursor: pointer;
  text-align: left;
}

.learning-check-toggle strong {
  display: block;
  margin-top: 2px;
  font-size: 1.35rem;
  line-height: 1.15;
}

.learning-check-toggle .eyebrow {
  display: block;
  margin: 0;
}

.learning-check-toggle small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-weight: 700;
}

.toggle-icon {
  display: grid;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 1.4rem;
  font-weight: 900;
  line-height: 1;
}

.learning-check-body {
  border-top: 1px solid var(--line);
  padding: 22px;
  background: #fbfafc;
}

.learning-check-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: start;
  max-width: 100%;
  margin: 0 auto 18px;
}

.section-intro {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--muted);
}

.quiz-list {
  display: grid;
  gap: 14px;
  max-width: 100%;
  margin: 0 auto;
}

.quiz-card {
  display: grid;
  gap: 14px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 18px;
}

.quiz-card legend {
  padding: 0 4px;
  color: var(--text);
  font-weight: 900;
  line-height: 1.35;
}

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

.choice-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 180px));
}

.choice-card {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
}

.choice-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-card span {
  display: flex;
  align-items: center;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  padding: 10px 13px 10px 42px;
  color: var(--text);
  line-height: 1.35;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.choice-card span::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 2px solid #b9b9c3;
  border-radius: 999px;
  transform: translateY(-50%);
  background: #fff;
}

.choice-card span::after {
  content: "";
  position: absolute;
  left: 19px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: transparent;
  transform: translateY(-50%);
}

.choice-card:hover span,
.choice-card.is-selected span,
.choice-card input:focus-visible + span {
  border-color: var(--brand);
  background: #fbf7fd;
  box-shadow: 0 0 0 3px rgba(106, 0, 151, 0.08);
}

.choice-card.is-selected span::before {
  border-color: var(--brand);
}

.choice-card.is-selected span::after {
  background: var(--brand);
}

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

.match-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  border: 1px solid #ebe7ef;
  border-radius: var(--radius);
  background: #fbfafc;
  padding: 13px;
}

.match-card strong {
  color: var(--brand);
  font-weight: 800;
}

.match-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.match-option {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  padding: 6px 10px;
  cursor: pointer;
  font-weight: 700;
  line-height: 1.2;
  text-align: left;
}

.match-option:hover,
.match-option.is-selected,
.match-option:focus-visible {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-dark);
  outline: none;
}

.quiz-feedback {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.quiz-card.is-correct {
  border-color: #3aa76d;
  background: #f3fbf7;
}

.quiz-card.is-correct .quiz-feedback {
  color: #237a4c;
}

.quiz-card.is-wrong {
  border-color: #d9a7a5;
  background: #fff8f8;
}

.quiz-card.is-wrong .quiz-feedback {
  color: #a33330;
}

.quiz-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 100%;
  margin-top: 16px;
  margin-left: auto;
  margin-right: auto;
}

.quiz-result {
  color: var(--brand);
  font-weight: 900;
}

.article-body {
  max-width: 820px;
  color: var(--text);
}

mark {
  border-radius: 3px;
  background: #fff0a6;
  color: inherit;
}

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

@media (max-width: 1100px) {
  .main {
    width: 100%;
  }

  .topbar {
    gap: 10px;
    padding-inline: 20px;
  }

  .lesson-tabs {
    max-width: 36vw;
  }

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

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

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

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

  .lesson-layout,
  .video-panel {
    grid-template-columns: 1fr;
  }

  .lesson-outline {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    position: static;
    max-height: none;
  }

}

@media (max-width: 780px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar-collapsed .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    width: min(82vw, 310px);
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }

  .sidebar-collapsed .sidebar {
    opacity: 1;
    pointer-events: auto;
  }

  .nav-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    color: var(--brand);
    cursor: pointer;
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
  }

  .sidebar-close:hover,
  .sidebar-close:focus-visible {
    border-color: var(--brand);
    background: #fbf7fd;
    outline: none;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    padding: 12px 16px;
    gap: 10px;
  }

  .menu-button {
    display: inline-flex;
    min-height: 44px;
  }

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

  .search-button {
    min-height: 44px;
    flex: initial;
  }

  .lesson-tabs {
    grid-column: 1 / -1;
    margin-left: 0;
    max-width: 100%;
    padding: 2px 0 4px;
    mask-image: linear-gradient(90deg, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
  }

  .main {
    padding: 24px 16px 42px;
  }

  .hero-band,
  .detail-header {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .detail-actions {
    flex-wrap: wrap;
  }

  .card-grid,
  .card-grid.compact,
  .stats-grid,
  .filters {
    grid-template-columns: 1fr;
  }

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

  .document-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .learning-check {
    padding: 22px 16px;
  }

  .learning-check-toggle {
    padding: 18px 16px;
  }

  .learning-check-toggle strong {
    font-size: 1.15rem;
  }

  .learning-check-body {
    padding: 16px;
  }

  .learning-check-header {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .quiz-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .choice-grid.compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .topbar {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .search-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .search-suggestions {
    position: fixed;
    top: 74px;
    left: 14px;
    right: 14px;
  }
}
