:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --text: #2f3640;
  --muted: #667085;
  --line: #d9dee7;
  --accent: #2563eb;
  --accent-soft: #eaf1ff;
  --green: #0f766e;
  --green-soft: #ecfdf5;
  --amber: #b45309;
  --amber-soft: #fff7ed;
  --rose: #be123c;
  --rose-soft: #fff1f2;
  --violet: #6d28d9;
  --violet-soft: #f5f3ff;
  --shadow: 0 12px 30px rgba(31, 41, 55, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 250px;
  min-height: 100vh;
}

.sidebar,
.toc {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--panel);
}

.sidebar {
  border-right: 1px solid var(--line);
  padding: 32px 24px;
}

.brand {
  margin: 0 0 22px;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: 0;
}

.nav {
  display: grid;
  gap: 2px;
  margin-top: 24px;
}

.nav a {
  display: block;
  border-radius: 6px;
  padding: 8px 10px;
  color: #515866;
  font-size: 15px;
  line-height: 1.2;
}

.nav a.active,
.nav a:hover {
  color: var(--accent);
  background: var(--accent-soft);
  text-decoration: none;
}

main {
  width: min(100%, 930px);
  padding: 34px 48px 80px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}

h3 {
  margin: 22px 0 8px;
  font-size: 20px;
}

p {
  margin: 0 0 14px;
}

ul {
  margin-top: 8px;
}

section {
  padding: 30px 0;
  border-top: 1px solid var(--line);
}

.lead {
  max-width: 760px;
  margin: 0 0 28px;
  color: #4b5563;
  font-size: 19px;
}

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

.learning-materials {
  padding-top: 20px;
}

.learning-material-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 6px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font-weight: 650;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.note {
  border-left: 4px solid var(--accent);
  background: var(--accent-soft);
  padding: 14px 16px;
  border-radius: 0 6px 6px 0;
}

.notice-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notice-list li {
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: var(--accent-soft);
  padding: 12px 14px;
}

.collapse-stack {
  display: grid;
  gap: 12px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 18px;
}

.panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 750;
  list-style: none;
}

.panel summary::-webkit-details-marker {
  display: none;
}

.panel summary::after {
  content: "+";
  color: var(--accent);
  font-size: 24px;
  line-height: 1;
}

.panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.panel[open] summary::after {
  content: "−";
}

.panel-body {
  padding: 18px;
}

.resource-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resource-list li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fbfcfe;
}

.resource-list strong {
  display: block;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.tool-group {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px 16px;
  background: #fbfcfe;
}

.tool-group h3 {
  margin-top: 0;
}

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

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

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
}

.card strong {
  display: block;
  margin-bottom: 4px;
}

.highlight-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
  padding: 18px;
  box-shadow: var(--shadow);
}

.highlight-panel h2 {
  margin-top: 0;
}

.book-grid {
  display: grid;
  gap: 14px;
}

.book-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 16px;
  box-shadow: var(--shadow);
}

.book-card h3 {
  margin-top: 0;
}

.book-cover {
  width: 112px;
  max-width: 100%;
  border-radius: 4px;
  box-shadow: 0 8px 18px rgba(31, 41, 55, 0.14);
}

.responsive-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
  margin: 12px 0 18px;
}

.simple-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.simple-table th,
.simple-table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.simple-table th {
  background: #eef2f7;
  font-weight: 800;
}

.simple-table tr:last-child td {
  border-bottom: 0;
}

.book-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tag,
.badge {
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.tag {
  display: inline-block;
  background: #eef2f7;
  color: #475467;
  font-weight: 700;
}

.calendar {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
}

.day {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.day h3 {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  font-size: 15px;
}

.event {
  margin: 10px;
  border-left: 4px solid var(--green);
  border-radius: 5px;
  background: var(--green-soft);
  padding: 9px 10px;
  font-size: 14px;
}

.event.deadline {
  border-color: var(--amber);
  background: var(--amber-soft);
}

.event.test {
  border-color: var(--rose);
  background: var(--rose-soft);
}

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

.doc {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px 16px;
}

.doc strong {
  display: block;
}

.doc span {
  color: var(--muted);
  font-size: 14px;
}

.calendar-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}

.legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  padding: 3px 8px;
  color: #475467;
  font-size: 12px;
  font-weight: 650;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
}

.dot.assignment {
  background: var(--amber);
}

.dot.test {
  background: var(--rose);
}

.dot.break {
  background: var(--violet);
}

.dot.empty {
  background: #94a3b8;
}

.term {
  display: grid;
  gap: 4px;
  margin: 6px 0 14px;
}

.week {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 8px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  overflow: hidden;
}

.week-number {
  display: grid;
  place-items: center;
  background: #f1f5f9;
  color: #334155;
  font-weight: 800;
}

.week-content {
  min-width: 0;
  padding: 5px 8px 5px 0;
}

.week h3 {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  margin: 0 0 1px;
  font-size: 14px;
  line-height: 1.15;
}

.week .badge {
  padding: 1px 6px;
  font-size: 10px;
}

.module .badge {
  background: var(--green-soft);
  color: var(--green);
}

.assignment .badge {
  background: var(--amber-soft);
  color: var(--amber);
}

.test .badge {
  background: var(--rose-soft);
  color: var(--rose);
}

.break .badge {
  background: var(--violet-soft);
  color: var(--violet);
}

.week.empty {
  color: var(--muted);
  background: #f8fafc;
}

.week.empty .week-number {
  background: #e2e8f0;
  color: #64748b;
}

.week p {
  margin: 0;
  color: #4b5563;
  font-size: 12px;
  line-height: 1.25;
}

.calendar-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.calendar-column h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.2;
}

.toc {
  border-left: 1px solid var(--line);
  padding: 24px 26px;
}

.toc h2 {
  margin-bottom: 8px;
  font-size: 16px;
}

.toc a {
  display: block;
  border-left: 2px solid transparent;
  padding: 5px 0 5px 10px;
  color: #4b5563;
  font-size: 14px;
}

.toc a:hover {
  border-color: var(--accent);
  color: var(--accent);
  text-decoration: none;
}

footer {
  border-top: 1px solid var(--line);
  padding-top: 24px;
  color: var(--muted);
  font-size: 14px;
}

.mobilebar,
.mobile-menu {
  display: none;
}

@media (max-width: 1050px) {
  .layout {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .toc {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    background: var(--panel);
  }

  .layout {
    display: block;
  }

  .mobilebar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: 36px 1fr 36px;
    align-items: center;
    min-height: 40px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.96);
    padding: 0 18px;
  }

  .mobile-menu {
    display: block;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }

  .mobile-menu summary {
    position: fixed;
    top: 6px;
    left: 18px;
    z-index: 11;
    width: 28px;
    height: 28px;
    list-style: none;
    cursor: pointer;
  }

  .mobile-menu summary::-webkit-details-marker {
    display: none;
  }

  .mobile-menu .menu-icon {
    margin-top: 5px;
  }

  .mobile-menu[open] .mobile-nav {
    display: grid;
  }

  .mobile-nav {
    display: none;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 12px 18px;
  }

  .mobile-nav a {
    border-radius: 6px;
    padding: 8px 10px;
    color: #4b5563;
    font-size: 14px;
  }

  .mobile-title {
    overflow: hidden;
    color: #4b5563;
    font-size: 16px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .menu-icon {
    display: inline-block;
    position: relative;
    width: 18px;
    height: 18px;
    vertical-align: middle;
  }

  .menu-icon {
    border: 1.5px solid #4b5563;
    border-radius: 2px;
  }

  .menu-icon::before,
  .menu-icon::after {
    content: "";
    position: absolute;
    left: 5px;
    width: 7px;
    border-top: 1.5px solid #4b5563;
  }

  .menu-icon::before {
    top: 5px;
  }

  .menu-icon::after {
    top: 10px;
  }

  .sidebar {
    display: none;
  }

  main {
    width: 100%;
    padding: 18px 26px 56px;
  }

  h1 {
    font-size: 30px;
    line-height: 1.18;
  }

  h2 {
    font-size: 24px;
  }

  .eyebrow,
  .lead {
    display: none;
  }

  .hero-actions {
    margin-bottom: 24px;
  }

  .hero-actions .button:not(.primary) {
    display: none;
  }

  .summary-grid,
  .grid,
  .doc,
  .book-card {
    grid-template-columns: 1fr;
  }

  .learning-material-links {
    grid-template-columns: 1fr;
  }

  .book-cover {
    width: 96px;
  }

  .calendar {
    grid-template-columns: repeat(5, 220px);
  }

  .week {
    grid-template-columns: 64px 1fr;
  }

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