:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #eef3f6;
  --line: #dce3e8;
  --text: #17212b;
  --muted: #637282;
  --blue: #246bfe;
  --green: #16815f;
  --red: #c94b4b;
  --amber: #a86b00;
  --radius: 8px;
  --shadow: 0 10px 30px rgba(31, 43, 55, 0.08);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  letter-spacing: 0;
}

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

button {
  border: 0;
}

a {
  color: inherit;
}

.boot {
  padding: 32px;
}

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

.sidebar {
  background: #17212b;
  color: #fff;
  padding: 20px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: grid;
  gap: 4px;
  margin-bottom: 28px;
}

.brand strong {
  font-size: 20px;
}

.brand span,
.nav-caption {
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
}

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

.nav a {
  text-decoration: none;
  padding: 11px 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.82);
}

.nav a.active,
.nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.main {
  min-width: 0;
}

.topbar {
  min-height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 28px;
}

.topbar h1 {
  margin: 0;
  font-size: 22px;
}

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

.domain-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.domain-pill,
.status-pill,
.type-pill {
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}

.domain-pill.pending {
  color: var(--amber);
  background: #fff3d8;
}

.content {
  padding: 28px;
  display: grid;
  gap: 20px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

.panel,
.course-card,
.lesson-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

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

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
}

.metric strong {
  display: block;
  font-size: 28px;
  line-height: 1.1;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.course-card {
  overflow: hidden;
  display: grid;
}

.cover {
  min-height: 120px;
  padding: 18px;
  color: #fff;
  background:
    linear-gradient(120deg, rgba(23, 33, 43, 0.96), rgba(36, 107, 254, 0.72)),
    linear-gradient(45deg, #17212b, #246bfe);
  display: flex;
  align-items: flex-end;
}

.course-card:nth-child(3n + 2) .cover {
  background:
    linear-gradient(120deg, rgba(22, 129, 95, 0.94), rgba(23, 33, 43, 0.72)),
    linear-gradient(45deg, #16815f, #17212b);
}

.course-card:nth-child(3n + 3) .cover {
  background:
    linear-gradient(120deg, rgba(168, 107, 0, 0.92), rgba(23, 33, 43, 0.72)),
    linear-gradient(45deg, #a86b00, #17212b);
}

.course-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.course-body h2,
.panel h2,
.lesson-main h2 {
  margin: 0;
  font-size: 20px;
}

.course-body p,
.panel p,
.lesson-main p {
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

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

.progress {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}

.progress div {
  height: 100%;
  background: var(--green);
  width: var(--value, 0%);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.btn {
  min-height: 38px;
  padding: 9px 13px;
  border-radius: var(--radius);
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn.secondary {
  background: var(--surface-2);
  color: var(--text);
}

.btn.ghost {
  background: transparent;
  color: var(--blue);
  padding-inline: 0;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.module {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.module summary {
  cursor: pointer;
  padding: 16px;
  font-weight: 700;
}

.lesson-list {
  border-top: 1px solid var(--line);
}

.lesson-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
}

.lesson-row:first-child {
  border-top: 0;
}

.lesson-row a {
  text-decoration: none;
  font-weight: 650;
}

.status-pill.done {
  color: var(--green);
  background: #dff5ec;
}

.status-pill.locked {
  color: var(--red);
  background: #ffe5e5;
}

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

.lesson-nav {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: calc(100vh - 140px);
  overflow: auto;
}

.lesson-nav a {
  display: block;
  padding: 11px 12px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--muted);
}

.lesson-nav a:first-child {
  border-top: 0;
}

.lesson-nav a.active {
  color: var(--blue);
  background: #eef4ff;
  font-weight: 700;
}

.lesson-main {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  display: grid;
  gap: 18px;
}

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

.info-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fbfcfd;
}

.info-box strong {
  display: block;
  margin-bottom: 6px;
}

textarea,
input,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.question {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  display: grid;
  gap: 10px;
}

.chat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfd;
  min-height: 260px;
  padding: 14px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.bubble {
  max-width: 72%;
  padding: 10px 12px;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.bubble.user {
  justify-self: end;
  background: #eaf1ff;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

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

.table th {
  color: var(--muted);
  font-size: 13px;
}

pre {
  overflow: auto;
  background: #101820;
  color: #e8f0f6;
  border-radius: var(--radius);
  padding: 14px;
}

@media (max-width: 980px) {
  .layout,
  .lesson-layout,
  .grid.cols-2,
  .grid.cols-3,
  .metric-row,
  .info-grid {
    grid-template-columns: 1fr;
  }

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

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

  .domain-stack {
    justify-content: flex-start;
  }

  .content {
    padding: 18px;
  }

  .lesson-row {
    grid-template-columns: 1fr;
  }
}
