:root {
  --ink: #17211d;
  --muted: #64706c;
  --line: #dfe7e2;
  --paper: #fbfcf8;
  --surface: #ffffff;
  --green: #1f7a4c;
  --green-dark: #135437;
  --gold: #d99b2b;
  --blue: #2d6f9f;
  --red: #b9483b;
  --shadow: 0 20px 60px rgba(25, 45, 35, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
  height: 100vh;
  padding: 24px;
  border-right: 1px solid var(--line);
  background: #f6f8f3;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 8px;
  background: var(--green);
  color: #fff;
  font-weight: 800;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.exam-card span,
.eyebrow,
.stat-panel span,
.timeline span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item,
.tiny-button,
.primary-action,
.secondary-action {
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav-item {
  padding: 0 12px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  font-weight: 700;
}

.nav-item:hover,
.nav-item.active {
  background: #e7efe8;
  border-color: #cbdccf;
}

.exam-card {
  margin-top: auto;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.exam-card strong {
  display: block;
  margin-top: 8px;
  font-size: 26px;
}

.exam-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

main {
  min-width: 0;
  padding: 24px;
}

.hero {
  position: relative;
  min-height: 300px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
  background: #dce8dc;
}

.hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(10, 29, 21, 0.82), rgba(10, 29, 21, 0.34), rgba(10, 29, 21, 0.08));
}

.hero-overlay {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 300px;
  padding: 30px;
  color: #fff;
}

.hero h1 {
  max-width: 620px;
  margin: 10px 0;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.98;
  letter-spacing: 0;
}

.hero p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.6;
}

.hero .eyebrow {
  color: #f2cf76;
}

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

.primary-action,
.secondary-action,
.tiny-button {
  padding: 0 16px;
  font-weight: 800;
}

.primary-action {
  background: var(--gold);
  color: #201709;
}

.secondary-action,
.tiny-button {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}

.primary-action:hover,
.secondary-action:hover,
.tiny-button:hover,
.set-card:hover,
.library-grid a:hover {
  transform: translateY(-1px);
}

.view {
  display: none;
  margin-top: 24px;
}

.view.active {
  display: block;
}

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

.stat-panel,
.panel,
.timeline article,
.library-grid a {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.stat-panel {
  padding: 18px;
}

.stat-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 30px;
}

.stat-panel p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-grid,
.practice-layout,
.notes-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(0, 1.6fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  padding: 18px;
}

.section-head,
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head.wide {
  margin-bottom: 18px;
}

h2,
h3 {
  margin: 4px 0 0;
  letter-spacing: 0;
}

.checklist {
  display: grid;
  gap: 10px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-item {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border-left: 4px solid var(--green);
  background: #f7faf6;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.timeline article {
  padding: 16px;
}

.timeline p,
.markdown-reader p {
  color: var(--muted);
  line-height: 1.6;
}

.set-list,
.note-tabs,
.library-grid {
  display: grid;
  gap: 10px;
}

.set-card,
.note-tab {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.set-card strong,
.note-tab strong {
  display: block;
  margin-bottom: 4px;
}

.set-card span,
.note-tab span {
  color: var(--muted);
  font-size: 13px;
}

.set-card.active,
.note-tab.active {
  border-color: var(--green);
  background: #eef7ef;
}

.quiz-panel {
  min-height: 560px;
}

.timer {
  min-width: 88px;
  padding: 10px 12px;
  border: 1px solid #cfdcd4;
  border-radius: 8px;
  background: #f7faf6;
  text-align: center;
  font-weight: 800;
}

.quiz-empty {
  display: grid;
  min-height: 320px;
  place-items: center;
  border: 1px dashed #cbd8d1;
  border-radius: 8px;
  color: var(--muted);
}

.question-card {
  min-height: 320px;
}

.question-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
}

.question-text {
  margin: 12px 0 18px;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
}

.option-list {
  display: grid;
  gap: 10px;
}

.option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcf8;
  cursor: pointer;
}

.option input {
  margin-top: 2px;
  accent-color: var(--green);
}

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

.result-box {
  display: none;
  margin-top: 14px;
  padding: 14px;
  border-radius: 8px;
  background: #eef7ef;
  line-height: 1.6;
}

.result-box.active {
  display: block;
}

.reader-panel {
  min-height: 560px;
}

.markdown-reader {
  max-height: 68vh;
  overflow: auto;
  padding-right: 8px;
}

.markdown-reader h1,
.markdown-reader h2,
.markdown-reader h3 {
  margin-top: 18px;
}

.markdown-reader li {
  margin: 7px 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.library-grid a {
  display: block;
  min-height: 92px;
  padding: 16px;
  color: var(--ink);
  font-weight: 800;
  text-decoration: none;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .nav-item {
    text-align: center;
  }

  .exam-card {
    display: none;
  }

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

@media (max-width: 760px) {
  main,
  .sidebar {
    padding: 14px;
  }

  .hero-overlay {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px;
  }

  .stats-grid,
  .dashboard-grid,
  .practice-layout,
  .notes-layout,
  .timeline,
  .library-grid {
    grid-template-columns: 1fr;
  }

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