:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b23;
  --panel-soft: #101820;
  --text: #f0f6fc;
  --muted: #9da7b3;
  --line: #2a343f;
  --accent: #5fd0a5;
  --accent-strong: #8ee8c7;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100svh;
  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;
}

.login-shell,
.app-shell,
.lesson-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  animation: rise 220ms ease-out;
}

.login-shell {
  min-height: 100svh;
  display: grid;
  place-items: center;
}

.login-panel {
  width: min(620px, 100%);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 40px 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2rem, 7vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: 0;
  margin-bottom: 18px;
}

h2 {
  font-size: 1.7rem;
  letter-spacing: 0;
  margin-bottom: 10px;
}

.lede,
.muted {
  color: var(--muted);
}

.lede {
  font-size: 1.1rem;
  max-width: 56ch;
  margin-bottom: 28px;
}

.eyebrow {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
  text-transform: uppercase;
}

.primary-action,
button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--accent);
  color: #06110d;
  font: inherit;
  font-weight: 800;
  padding: 0 18px;
  text-decoration: none;
  transition: transform 140ms ease, background 140ms ease;
}

.primary-action:hover,
button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.compact {
  min-height: 40px;
}

.workspace-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.workspace-grid,
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 32px;
  align-items: start;
}

.workspace-main,
.workspace-side,
.lesson-body,
.lesson-tools {
  background: var(--panel-soft);
  border: 1px solid var(--line);
  padding: 24px;
}

.workspace-side,
.lesson-tools {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 22px;
}

.course-map {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.module-title,
.lesson-link {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.lesson-link {
  color: var(--text);
  text-decoration: none;
}

.lesson-link:hover {
  color: var(--accent-strong);
}

.status {
  color: var(--muted);
  white-space: nowrap;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  background: #26313b;
}

.progress-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.metric {
  color: var(--muted);
  margin: 10px 0 0;
}

.plain-list {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
}

.crumbs {
  display: flex;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 20px;
}

.lesson-body {
  font-size: 1.08rem;
}

.lesson-body h1 {
  font-size: clamp(2.2rem, 8vw, 5rem);
  margin-bottom: 22px;
}

.lesson-body li {
  margin-bottom: 8px;
}

.note-form {
  display: grid;
  gap: 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

@media (max-width: 840px) {
  .workspace-header,
  .workspace-grid,
  .lesson-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .workspace-side,
  .lesson-tools {
    position: static;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}