:root {
  --bg: #0e1117;
  --panel: #151a22;
  --panel-2: #1b2230;
  --line: #2a3443;
  --text: #f4f0e8;
  --muted: #a9abb3;
  --soft: #d7c8ad;
  --blue: #d94141;
  --green: #35c96f;
  --amber: #f5a524;
  --violet: #b66cff;
  --red: #d94141;
  --brand-white: #f5f2ec;
  --brand-black: #090b0f;
  --brand-gray: #8f949d;
  --radius: 8px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

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

.sidebar {
  border-right: 1px solid var(--line);
  background: #10151d;
  padding: 28px 20px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
}

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

.mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--red), #ffffff);
}

.brand h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.05;
}

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

.brand p {
  margin: 3px 0 0;
  font-size: 13px;
}

.student-panel,
.login-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}

.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(520px, 100%);
}

.login-panel h1 {
  margin: 0 0 10px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1;
}

.login-panel p {
  color: var(--muted);
  line-height: 1.55;
}

.field {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.field label {
  color: var(--soft);
  font-size: 13px;
}

.field input,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #0f141c;
  color: var(--text);
  padding: 13px 14px;
  outline: 0;
}

.field textarea {
  min-height: 128px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
}

.primary,
.ghost,
.danger {
  min-height: 42px;
  border-radius: var(--radius);
  padding: 0 14px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary {
  background: var(--blue);
}

.ghost {
  border: 1px solid var(--line);
  background: #111820;
}

.danger {
  background: rgba(255, 107, 107, 0.16);
  color: #ffd6d6;
}

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

.student-name {
  margin: 0;
  font-size: 18px;
}

.phone {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.progress-bar {
  height: 8px;
  background: #0c1016;
  border-radius: 99px;
  overflow: hidden;
  margin: 16px 0 8px;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: var(--value);
  background: linear-gradient(90deg, var(--green), var(--blue));
}

.stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0;
}

.stat {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
}

.stat strong {
  display: block;
  font-size: 22px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.content {
  padding: 34px;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.topbar h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 48px);
  line-height: 1;
}

.topbar p {
  color: var(--muted);
  margin: 8px 0 0;
  max-width: 680px;
  line-height: 1.5;
}

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: var(--muted);
  font-size: 14px;
}

.toggle input {
  width: 18px;
  height: 18px;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.lesson-list,
.lesson-view {
  display: grid;
  gap: 10px;
}

.lesson-item,
.lesson-card,
.empty {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: var(--radius);
}

.lesson-item {
  display: grid;
  grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
  column-gap: 12px;
  row-gap: 10px;
  align-items: center;
  padding: 12px;
  text-align: left;
  color: inherit;
}

.lesson-item:hover,
.lesson-item.active {
  border-color: rgba(59, 130, 246, 0.72);
  background: var(--panel-2);
}

.lesson-number {
  min-width: 34px;
  width: 100%;
  height: 34px;
  padding: 0 8px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: #0d1219;
  color: var(--soft);
  font-weight: 700;
}

.lesson-title {
  min-width: 0;
}

.lesson-title strong {
  display: block;
  line-height: 1.2;
  font-size: 15px;
}

.lesson-title span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  color: var(--text);
  border: 1px solid transparent;
}

.lesson-item .badge {
  grid-column: 2;
  width: max-content;
  padding: 4px 8px;
  font-size: 11px;
}

.badge.locked {
  color: #d8d9de;
  border-color: var(--line);
}

.badge.available {
  background: rgba(59, 130, 246, 0.16);
  color: #aacaFF;
}

.badge.completed {
  background: rgba(53, 201, 111, 0.16);
  color: #a9f3c8;
}

.lesson-card {
  padding: 22px;
  background: #ffffff;
  color: var(--brand-black);
  border-color: rgba(9, 11, 15, 0.12);
}

.lesson-card .field label {
  color: #3d424c;
}

.lesson-card .field textarea,
.lesson-card .field input {
  border-color: rgba(9, 11, 15, 0.18);
  background: #ffffff;
  color: var(--brand-black);
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.pill {
  border: 1px solid rgba(9, 11, 15, 0.14);
  border-radius: 999px;
  padding: 6px 10px;
  color: #555b66;
  background: #f5f5f5;
  font-size: 12px;
}

.lesson-card h3 {
  margin: 0 0 10px;
  font-size: clamp(32px, 3vw, 46px);
  line-height: 1.08;
}

.lesson-card p,
.lesson-card li {
  color: #272b33;
  line-height: 1.6;
}

.lesson-card .lesson-intro p {
  color: #252932;
}

.lesson-card ul {
  padding-left: 19px;
}

.notice {
  border-left: 4px solid var(--red);
  background: #fff0f0;
  padding: 12px 14px;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: #551414;
  line-height: 1.45;
}

.lesson-passport {
  display: grid;
  gap: 18px;
  margin-top: 18px;
}

.lesson-intro,
.lesson-section {
  border: 1px solid rgba(9, 11, 15, 0.12);
  border-radius: var(--radius);
  background: #ffffff;
  padding: 18px;
}

.lesson-intro {
  border-color: rgba(217, 65, 65, 0.28);
  background: #fff7f7;
  color: var(--brand-black);
}

.lesson-intro p {
  color: #252932;
}

.eyebrow {
  display: inline-flex;
  width: max-content;
  border: 1px solid rgba(9, 11, 15, 0.18);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--brand-black);
  background: rgba(9, 11, 15, 0.06);
  font-size: 12px;
  margin-bottom: 12px;
}

.lesson-intro h4,
.lesson-section h4 {
  margin: 0;
  font-size: 20px;
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.section-heading span {
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  display: grid;
  place-items: center;
  background: var(--brand-black);
  color: #ffffff;
  font-weight: 700;
}

.lesson-section-critical {
  border-color: rgba(217, 65, 65, 0.42);
  background: #fff5f5;
  box-shadow: inset 4px 0 0 var(--red);
}

.lesson-section-critical .section-heading span {
  background: var(--red);
  color: #ffffff;
}

.lesson-section-critical h4 {
  color: var(--brand-black);
}

.important-note {
  margin: 0 0 12px;
  border-radius: var(--radius);
  background: var(--red);
  color: #ffffff;
  padding: 12px 14px;
  font-weight: 800;
  line-height: 1.35;
}

.clean-list {
  margin: 0;
  padding-left: 23px;
}

.clean-list li + li {
  margin-top: 8px;
}

.preparation-resources {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.preparation-resource {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  border: 1px solid rgba(217, 65, 65, 0.28);
  border-left: 4px solid var(--red);
  border-radius: var(--radius);
  background: #fff8f8;
  padding: 16px;
}

.preparation-resource-copy strong {
  display: block;
  color: var(--brand-black);
  font-size: 17px;
}

.preparation-resource-copy p {
  margin: 7px 0 0;
  color: #34373d;
  line-height: 1.5;
}

.preparation-resource-copy small {
  display: block;
  margin-top: 8px;
  color: #727780;
}

.preparation-resource-link {
  margin: 0;
  text-decoration: none;
  white-space: nowrap;
}

.substeps {
  border: 1px solid rgba(9, 11, 15, 0.12);
  border-radius: var(--radius);
  background: #f6f7f8;
  padding: 14px;
  margin: 16px 0;
}

.substeps h4 {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--brand-black);
}

.lesson-link {
  margin-top: 14px;
  text-decoration: none;
  width: max-content;
  background: var(--red);
}

.prompt-box {
  margin: 12px 0 0;
  white-space: pre-wrap;
  border: 1px solid rgba(9, 11, 15, 0.16);
  border-radius: var(--radius);
  background: #f6f7f8;
  color: var(--brand-black);
  padding: 14px;
  line-height: 1.55;
  overflow: auto;
}

.links {
  display: grid;
  gap: 8px;
  margin: 18px 0;
}

.links a {
  color: #b72b2b;
  text-decoration: none;
  word-break: break-word;
}

.links a:hover {
  text-decoration: underline;
}

.materials {
  margin-top: 22px;
  display: grid;
  gap: 10px;
}

.materials h4 {
  margin: 0;
  font-size: 18px;
  color: var(--brand-black);
}

.source-post {
  border: 1px solid rgba(9, 11, 15, 0.14);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.source-post-title {
  padding: 13px 14px;
  color: var(--brand-black);
  background: #f6f7f8;
  font-weight: 800;
}

.source-post .lesson-links {
  padding: 0 14px 14px;
}

.post-text {
  border-top: 1px solid rgba(9, 11, 15, 0.12);
  padding: 4px 14px 14px;
  max-height: 420px;
  overflow: auto;
}

.post-media {
  border-top: 1px solid rgba(9, 11, 15, 0.12);
  padding: 14px;
  display: grid;
  gap: 12px;
}

.post-media video {
  width: 100%;
  max-height: 420px;
  border-radius: var(--radius);
  background: #05070a;
}

.slide-deck-card {
  margin-top: 18px;
  border: 1px solid rgba(9, 11, 15, 0.12);
  border-radius: var(--radius);
  background: #ffffff;
  overflow: hidden;
}

.slide-deck-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid rgba(9, 11, 15, 0.1);
}

.slide-deck-header strong,
.slide-deck-header span {
  display: block;
}

.slide-deck-header strong {
  color: var(--brand-black);
  font-size: 18px;
  line-height: 1.25;
}

.slide-deck-header span {
  margin-top: 4px;
  color: #5d626b;
  font-size: 14px;
  line-height: 1.4;
}

.slide-swipe-cue {
  flex: 0 0 auto;
  margin-top: 0 !important;
  border-radius: 999px;
  background: #fff0f0;
  color: var(--red) !important;
  border: 1px solid rgba(217, 65, 65, 0.26);
  padding: 8px 11px;
  font-weight: 800;
}

.slide-deck {
  padding: 16px;
}

.slide-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  background: #f4f4f4;
  border: 1px solid rgba(9, 11, 15, 0.1);
  overflow: hidden;
}

.slide-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transform: translateX(10px);
  transition: opacity 180ms ease, transform 180ms ease;
  background: #ffffff;
  pointer-events: none;
}

.slide-image.active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.slide-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 14px;
}

.slide-nav {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  cursor: pointer;
  line-height: 1;
}

.slide-nav:hover {
  background: #b72b2b;
}

.slide-counter {
  min-width: 62px;
  text-align: center;
  color: var(--brand-black);
  font-weight: 800;
}

.slide-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 12px;
}

.slide-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(9, 11, 15, 0.24);
  cursor: pointer;
  padding: 0;
}

.slide-dot.active {
  width: 28px;
  background: var(--red);
}

@media (max-width: 760px) {
  .preparation-resource {
    grid-template-columns: 1fr;
  }

  .preparation-resource-link {
    width: 100%;
    white-space: normal;
  }
}

.post-text p {
  margin: 12px 0;
}

.compact {
  padding: 14px;
}

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

.empty {
  padding: 28px;
  color: var(--muted);
}

.block-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.block-foundation {
  background: var(--red);
}

.block-content {
  background: var(--brand-white);
}

.block-bot {
  background: var(--brand-gray);
}

.block-bonus {
  background: #ffffff;
  box-shadow: inset 0 0 0 2px var(--red);
}

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

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

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

  .lesson-item {
    grid-template-columns: minmax(58px, auto) minmax(0, 1fr) auto;
  }

  .lesson-item .badge {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .content,
  .sidebar {
    padding: 20px 14px;
  }

  .topbar {
    display: grid;
  }

  .lesson-item {
    grid-template-columns: minmax(58px, auto) minmax(0, 1fr);
  }

  .lesson-item .badge {
    grid-column: 2;
    width: max-content;
  }
}
