:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #fbfcfd;
  --ink: #182026;
  --muted: #60707c;
  --line: #c7d2dd;
  --accent: #1b6f6a;
  --accent-strong: #0e4e4a;
  --accent-soft: #dcefeb;
  --question: #d83f31;
  --answer: #2778b8;
  --shadow: 0 18px 40px rgba(15, 36, 48, 0.08);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #191816;
  --surface: #22211f;
  --surface-strong: #2a2926;
  --ink: #f4efe6;
  --muted: #b9afa0;
  --line: #3d3932;
  --accent: #7ccbc1;
  --accent-strong: #a8e5dc;
  --accent-soft: #183d3a;
  --question: #f08b80;
  --answer: #8ec9f2;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

a {
  color: var(--accent-strong);
  text-underline-offset: 0.18em;
}

.course-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(16px);
}

.brand {
  color: var(--ink);
  font-weight: 760;
  text-decoration: none;
}

.course-nav {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.course-nav a,
.button,
.theme-button,
.material-tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
}

.course-nav a,
.button,
.material-tabs button {
  padding: 0 14px;
}

.theme-button {
  width: 38px;
}

.button-primary,
.material-tabs button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.course-shell {
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.course-hero {
  display: grid;
  gap: 14px;
  padding-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.4rem);
}

h2 {
  font-size: clamp(1.55rem, 2.5vw, 2.35rem);
}

h3 {
  font-size: 1.05rem;
}

.hero-actions,
.exam-links,
.material-tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.course-band {
  display: grid;
  gap: 18px;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}

.section-head {
  display: grid;
  gap: 5px;
}

.section-head-with-tools {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.qa-item,
.rules-panel,
.syllabus-card,
.material-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.qa-item {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.qa-item p {
  margin: 0;
}

.qa-official {
  display: grid;
  gap: 0.24rem;
}

.qa-official .answer-line {
  padding-left: 1rem;
}

.question-label {
  color: var(--question);
}

.qa-item p {
  color: var(--ink);
}

.answer-label {
  color: var(--answer);
}

.rules-panel {
  padding: 18px;
}

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

.bloom-list,
.exam-list {
  margin: 14px 0 0;
  padding-left: 1.35rem;
}

.bloom-list li,
.exam-list li {
  margin: 0.42rem 0;
}

.bloom-list strong {
  color: var(--accent-strong);
}

.bloom-official {
  padding-left: 3.5rem;
}

.bloom-official p {
  margin: 0.65rem 0 0;
}

.student-keyword {
  color: #005eea;
  font-weight: 750;
}

.proctor-keyword {
  color: #e31313;
  font-weight: 750;
}

.exam-links {
  margin-top: 12px;
}

.exam-links a {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--accent-soft);
  text-decoration: none;
  font-weight: 700;
}

.syllabus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.syllabus-card {
  display: grid;
  gap: 8px;
  padding: 18px;
  color: var(--ink);
  text-decoration: none;
}

.material-empty {
  color: var(--muted);
}

.syllabus-card strong {
  font-size: 1.7rem;
  color: var(--accent-strong);
}

.material-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.material-search input {
  width: min(30vw, 320px);
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

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

.material-group {
  display: grid;
  gap: 10px;
}

.material-group h3 {
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--accent-strong);
}

.material-group h4 {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.material-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
}

.material-card strong {
  line-height: 1.3;
}

.course-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.8rem;
  align-items: center;
  width: min(1120px, calc(100vw - 36px));
  margin: 0 auto 34px;
  padding-top: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 860px) {
  .course-header {
    padding: 0 14px;
  }

  .course-shell {
    padding-top: 30px;
  }

  .section-head-with-tools {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .material-search span {
    display: none;
  }

  .material-search input {
    width: min(60vw, 260px);
  }
}
