:root {
  --blue-900: #173b5f;
  --blue-800: #1f4e79;
  --blue-700: #2b6598;
  --blue-100: #e9f2fa;
  --grey-950: #121821;
  --grey-800: #2c3644;
  --grey-650: #607084;
  --grey-300: #d7dee8;
  --grey-200: #e7ebf1;
  --grey-100: #f3f6fa;
  --grey-50: #f8fafc;
  --white: #ffffff;
  --green: #237a51;
  --red: #b84040;
  --amber: #a8641a;
  --shadow: 0 18px 50px rgba(18, 24, 33, 0.08);
  --lesson-content-width: 1120px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(43, 101, 152, 0.38);
  outline-offset: 2px;
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
}

.auth-panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 32px;
  align-items: center;
  background: var(--white);
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  padding: 36px;
  box-shadow: var(--shadow);
}

.auth-panel h1 {
  max-width: 620px;
  margin: 0;
  color: var(--blue-900);
  font-size: 42px;
  line-height: 1.1;
  letter-spacing: 0;
}

.auth-copy {
  max-width: 560px;
  color: var(--grey-650);
  font-size: 18px;
}

.ideate-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--blue-700);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.ideate-home-link:hover {
  color: var(--blue-900);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-home-link {
  margin-bottom: 16px;
}

.auth-form {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--grey-200);
  border-radius: 8px;
  background: var(--grey-50);
}

.auth-form label {
  display: grid;
  gap: 7px;
  color: var(--grey-800);
  font-weight: 700;
}

.auth-form input {
  width: 100%;
  border: 1px solid var(--grey-300);
  border-radius: 6px;
  padding: 12px 13px;
  background: var(--white);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--white);
}

.tab-button {
  border: 0;
  border-radius: 6px;
  padding: 10px;
  color: var(--grey-650);
  background: transparent;
  font-weight: 800;
}

.tab-button.active {
  color: var(--white);
  background: var(--blue-800);
}

.form-error {
  min-height: 22px;
  margin: 0;
  color: var(--red);
  font-weight: 700;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 68px;
  padding: 0 18px;
  background: var(--white);
  border-bottom: 1px solid var(--grey-200);
}

.brand-block {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--blue-800);
  color: var(--white);
  font-weight: 900;
  letter-spacing: 0;
}

.brand-title,
.brand-subtitle,
.eyebrow,
.sidebar-title {
  margin: 0;
}

.brand-title {
  color: var(--blue-900);
  font-weight: 900;
}

.brand-subtitle,
.user-email {
  color: var(--grey-650);
  font-size: 13px;
}

.user-progress-menu {
  display: grid;
  justify-items: end;
  gap: 1px;
  min-width: 0;
  line-height: 1.2;
}

.user-email {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.progress-link-button {
  border: 0;
  padding: 2px 0;
  background: transparent;
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.progress-link-button:hover {
  color: var(--blue-900);
}

.topbar-spacer {
  flex: 1;
}

.topbar-home-link {
  flex: 0 0 auto;
  border: 1px solid var(--grey-300);
  border-radius: 6px;
  padding: 8px 10px;
  background: var(--grey-50);
}

.topbar-home-link:hover {
  background: var(--blue-100);
  text-decoration: none;
}

.progress-dashboard {
  min-height: calc(100vh - 68px);
  padding: 34px;
  background: var(--grey-100);
}

.progress-shell {
  width: min(1380px, 100%);
  margin: 0 auto;
}

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

.progress-header h1 {
  margin: 5px 0 6px;
  color: var(--blue-900);
  font-size: 38px;
  line-height: 1.1;
}

.progress-header h1:focus {
  outline: none;
}

.progress-header p:not(.eyebrow) {
  max-width: 700px;
  margin: 0;
  color: var(--grey-650);
}

.progress-error {
  margin: 0 0 18px;
  padding: 13px 15px;
  border-left: 4px solid var(--red);
  background: #fff0f0;
  color: var(--red);
  font-weight: 800;
}

.progress-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.progress-metric {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--white);
}

.progress-metric.is-overall {
  border-color: var(--blue-900);
  background: var(--blue-900);
  color: var(--white);
}

.progress-metric-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.progress-metric h2,
.progress-metric p {
  margin: 0;
}

.progress-metric h2 {
  color: var(--blue-900);
  font-size: 16px;
}

.progress-metric strong {
  color: var(--blue-900);
  font-size: 25px;
}

.progress-metric.is-overall h2,
.progress-metric.is-overall strong {
  color: var(--white);
}

.progress-metric progress {
  width: 100%;
  height: 10px;
  margin: 16px 0 10px;
  accent-color: var(--blue-700);
}

.progress-metric.is-overall progress {
  accent-color: #8fc0ed;
}

.progress-metric p {
  color: var(--grey-650);
  font-size: 13px;
  font-weight: 800;
}

.progress-metric.is-overall p {
  color: #dcebf8;
}

.progress-table-section {
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.progress-table-heading {
  padding: 18px 20px;
  border-bottom: 1px solid var(--grey-200);
}

.progress-table-heading h2 {
  margin: 4px 0 0;
  color: var(--blue-900);
}

.progress-table-scroll {
  overflow-x: auto;
}

.progress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.progress-table th,
.progress-table td {
  padding: 14px 12px;
  border-bottom: 1px solid var(--grey-200);
  text-align: left;
  vertical-align: top;
}

.progress-table thead th {
  background: var(--grey-50);
  color: var(--grey-650);
  font-size: 12px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.progress-table tbody tr:last-child th,
.progress-table tbody tr:last-child td {
  border-bottom: 0;
}

.progress-table tbody tr:hover {
  background: #fbfcfe;
}

.progress-chapter-title,
.progress-chapter-availability,
.progress-status,
.progress-status-detail {
  display: block;
}

.progress-chapter-title {
  min-width: 180px;
  color: var(--blue-900);
}

.progress-chapter-heading {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
}

.progress-chapter-availability,
.progress-status-detail {
  margin-top: 4px;
  color: var(--grey-650);
  font-size: 12px;
  font-weight: 500;
}

.progress-status {
  width: max-content;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 8px;
  background: var(--grey-200);
  color: var(--grey-800);
  font-size: 12px;
  font-weight: 900;
}

.progress-status.is-complete {
  background: #e6f4ec;
  color: var(--green);
}

.progress-status.is-in-progress {
  background: #fff4dc;
  color: var(--amber);
}

.progress-status.is-not-started {
  background: var(--grey-200);
  color: var(--grey-650);
}

.progress-resume-button {
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: calc(100vh - 68px);
}

.sidebar {
  position: sticky;
  top: 68px;
  height: calc(100vh - 68px);
  overflow: auto;
  scrollbar-width: none;
  background: var(--white);
  border-right: 1px solid var(--grey-200);
  transition: width 160ms ease;
}

.sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.sidebar-header {
  padding: 20px 18px 10px;
}

.eyebrow {
  color: var(--blue-700);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sidebar-title {
  color: var(--grey-800);
  font-size: 18px;
  font-weight: 900;
}

.curriculum-nav {
  display: grid;
  gap: 8px;
  padding: 8px 10px 28px;
}

.module-group {
  border-bottom: 1px solid var(--grey-200);
  padding-bottom: 8px;
}

.module-summary {
  display: flex;
  align-items: center;
  padding: 10px 8px;
  color: var(--blue-900);
  font-size: 16px;
  font-weight: 500;
}

.module-initial {
  display: none;
}

.chapter-list {
  display: grid;
  gap: 3px;
}

.chapter-button {
  width: 100%;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  padding: 9px 8px;
  color: var(--grey-800);
  background: transparent;
  text-align: left;
}

.chapter-button:hover,
.chapter-button.active {
  background: var(--blue-100);
  color: var(--blue-900);
}

.chapter-number {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--grey-100);
  color: var(--grey-650);
  font-size: 12px;
  font-weight: 900;
}

.chapter-button.active .chapter-number {
  background: var(--blue-800);
  color: var(--white);
}

.chapter-name {
  overflow: hidden;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-collapsed .workspace {
  grid-template-columns: 76px minmax(0, 1fr);
}

.nav-collapsed .sidebar-header,
.nav-collapsed .module-title,
.nav-collapsed .chapter-name {
  display: none;
}

.nav-collapsed .module-summary {
  justify-content: center;
  padding: 10px 0;
}

.nav-collapsed .module-initial {
  display: block;
  color: var(--blue-900);
}

.nav-collapsed .curriculum-nav {
  padding: 12px 8px;
}

.nav-collapsed .chapter-button {
  grid-template-columns: 1fr;
  justify-items: center;
}

.main-panel {
  min-width: 0;
  padding: 34px;
  background: var(--white);
}

.lesson-root,
.playground {
  width: min(var(--lesson-content-width), 100%);
  margin: 0 auto;
}

.lesson-hero {
  padding-bottom: 24px;
  border-bottom: 1px solid var(--grey-300);
}

.lesson-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.status-pill,
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  background: var(--grey-200);
  color: var(--grey-800);
  font-size: 12px;
  font-weight: 900;
}

.status-pill.ready {
  background: #e6f4ec;
  color: var(--green);
}

.status-pill.loading {
  background: #fff4dc;
  color: var(--amber);
}

.status-pill.error {
  background: #fae9e9;
  color: var(--red);
}

.lesson-hero h1 {
  margin: 6px 0;
  color: var(--blue-900);
  font-size: 40px;
  line-height: 1.1;
  letter-spacing: 0;
}

.lesson-hero p {
  max-width: var(--lesson-content-width);
  margin: 0;
  color: var(--grey-650);
  font-size: 17px;
}

.lesson-section {
  padding: 28px 0;
  border-bottom: 1px solid var(--grey-200);
}

[data-progress-section][tabindex="-1"]:focus,
[data-progress-assignment][tabindex="-1"]:focus {
  outline: none;
}

[data-progress-section].resume-focus,
[data-progress-assignment].resume-focus {
  animation: resume-focus 1800ms ease-out;
}

@keyframes resume-focus {
  0% {
    box-shadow: 0 0 0 5px rgba(43, 101, 152, 0.26);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(43, 101, 152, 0);
  }
}

.lesson-section h2 {
  margin: 0 0 16px;
  color: var(--blue-900);
  font-size: 25px;
  letter-spacing: 0;
}

.quiz-header-actions,
.quiz-retry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  column-gap: 15px;
  row-gap: 8px;
}

.quiz-header-actions {
  margin-left: auto;
}

.quiz-header-actions > button,
.quiz-header-actions .quiz-retry-actions > button {
  height: 42px;
}

.lesson-section h3 {
  margin: 24px 0 8px;
  color: var(--grey-950);
  font-size: 20px;
}

.lesson-section p {
  max-width: var(--lesson-content-width);
  color: var(--grey-800);
}

.lesson-section > p,
.objectives-grid,
.content-list,
.callout,
.code-card,
.assignment-card,
.quiz-panel,
.planned-note,
.chapter-pager {
  width: 100%;
  max-width: var(--lesson-content-width);
}

.chapter-pager {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 0 0;
}

.chapter-pager button {
  max-width: min(420px, 48%);
}

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

.objectives-grid li,
.content-list li {
  padding: 10px 12px;
  border: 1px solid var(--grey-200);
  border-left: 4px solid var(--blue-700);
  border-radius: 0;
  background: var(--grey-50);
}

.content-list {
  display: grid;
  gap: 8px;
  padding-left: 0;
  list-style: none;
}

strong {
  color: var(--blue-900);
}

.callout {
  margin: 18px 0;
  padding: 16px 18px;
  border-left: 5px solid var(--blue-800);
  border-radius: 0;
  background: var(--blue-100);
}

.callout h4 {
  margin: 0 0 6px;
  color: var(--blue-900);
}

.callout p {
  margin: 0;
}

.code-card,
.assignment-card,
.quiz-panel {
  margin: 18px auto;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--white);
  overflow: hidden;
}

.code-toolbar,
.assignment-header,
.quiz-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--grey-200);
  background: var(--grey-50);
}

.code-toolbar h4,
.assignment-header h3,
.quiz-header h3 {
  margin: 0;
  color: var(--blue-900);
}

.code-toolbar p,
.assignment-header p,
.quiz-header p {
  margin: 4px 0 0;
  color: var(--grey-650);
  font-size: 14px;
}

pre {
  margin: 0;
  overflow: auto;
  white-space: pre-wrap;
}

code,
pre,
textarea {
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.code-block {
  padding: 16px;
  background: #f7f9fc;
  color: #142235;
  font-size: 14px;
}

.primary-button,
.danger-button,
.ghost-button,
.icon-button,
.small-button {
  border-radius: 6px;
  font-weight: 900;
}

.primary-button {
  border: 1px solid var(--blue-800);
  background: var(--blue-800);
  color: var(--white);
  padding: 10px 14px;
}

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

.danger-button {
  border: 1px solid #b42318;
  background: #b42318;
  color: var(--white);
  padding: 10px 16px;
}

.danger-button:hover {
  border-color: #8f1d14;
  background: #8f1d14;
}

.ghost-button {
  border: 1px solid var(--grey-300);
  background: var(--white);
  color: var(--blue-900);
  padding: 10px 13px;
}

.ghost-button:hover {
  background: var(--grey-100);
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--grey-300);
  background: var(--white);
  color: var(--blue-900);
}

.small-button {
  border: 1px solid var(--grey-300);
  background: var(--white);
  color: var(--blue-900);
  padding: 8px 10px;
}

.primary-button:disabled,
.danger-button:disabled,
.ghost-button:disabled,
.small-button:disabled,
.icon-button:disabled {
  cursor: default;
  opacity: 0.55;
}

.completion-button-shell {
  position: relative;
  display: inline-flex;
}

.completion-button-shell[data-tooltip]::after {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: min(300px, 78vw);
  padding: 9px 11px;
  border-radius: 7px;
  background: #172033;
  color: var(--white);
  box-shadow: 0 10px 28px rgb(16 24 40 / 20%);
  content: attr(data-tooltip);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transform: translateY(4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.completion-button-shell[data-tooltip]::before {
  position: absolute;
  z-index: 21;
  right: 18px;
  bottom: calc(100% + 4px);
  width: 12px;
  height: 12px;
  background: #172033;
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: rotate(45deg);
  transition: opacity 140ms ease;
}

.completion-button-shell[data-tooltip]:hover::after,
.completion-button-shell[data-tooltip]:hover::before,
.completion-button-shell[data-tooltip]:focus-within::after,
.completion-button-shell[data-tooltip]:focus-within::before {
  opacity: 1;
}

.completion-button-shell[data-tooltip]:hover::after,
.completion-button-shell[data-tooltip]:focus-within::after {
  transform: translateY(0);
}

.assignment-list {
  display: grid;
  gap: 16px;
}

.assignment-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.criteria-list,
.hint-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.assignment-actions,
.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.confirmation-dialog {
  width: min(520px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: var(--white);
  color: var(--grey-950);
  box-shadow: 0 24px 80px rgb(16 24 40 / 32%);
}

.confirmation-dialog::backdrop {
  background: rgb(15 23 42 / 58%);
  backdrop-filter: blur(3px);
}

.confirmation-dialog[open] {
  animation: confirmation-dialog-enter 170ms ease-out;
}

.confirmation-dialog-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px 16px;
  padding: 26px;
}

.confirmation-dialog-icon {
  display: grid;
  width: 42px;
  height: 42px;
  grid-row: span 1;
  place-items: center;
  border-radius: 50%;
  background: #fee4e2;
  color: #b42318;
  font-size: 22px;
  font-weight: 900;
}

.solution-confirmation-icon {
  background: var(--blue-100);
  color: var(--blue-800);
}

.assignment-leave-icon {
  background: #fff4dc;
  color: var(--amber);
}

.confirmation-dialog-card h2 {
  margin: 2px 0 0;
  color: var(--blue-900);
}

.confirmation-dialog-card > p,
.confirmation-dialog-actions {
  grid-column: 1 / -1;
}

.confirmation-dialog-card > p {
  margin: 0;
  color: var(--grey-650);
}

.confirmation-dialog-error {
  padding: 10px 12px;
  border-radius: 7px;
  background: #fff1f0;
  color: #9f1c13 !important;
  font-weight: 700;
}

.confirmation-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

@keyframes confirmation-dialog-enter {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.98);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.action-feedback {
  min-height: 22px;
  margin: 0;
  color: var(--grey-650);
  font-size: 13px;
  font-weight: 800;
}

.action-feedback.is-success {
  color: var(--green);
}

.action-feedback.is-error {
  color: var(--red);
}

.content-completion {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.content-completion h2,
.content-completion p {
  margin-top: 0;
}

.content-completion-action {
  display: grid;
  flex: 0 0 auto;
  justify-items: end;
  gap: 8px;
}

.content-completion-action .action-feedback {
  max-width: 360px;
  text-align: right;
}

.solution-block {
  border-top: 1px solid var(--grey-200);
  display: grid;
  gap: 12px;
  padding-top: 14px;
}

.solution-steps {
  display: grid;
  gap: 8px;
}

.solution-steps ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 20px;
}

.quiz-question {
  padding: 18px 0;
  border-top: 1px solid var(--grey-200);
}

.quiz-question:first-child {
  border-top: 0;
}

.quiz-options {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.quiz-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--grey-200);
  border-radius: 6px;
  background: var(--white);
}

.quiz-option.selected-correct {
  border-color: rgba(35, 122, 81, 0.45);
  background: #eef8f2;
}

.quiz-option.missed-correct {
  border-color: rgba(168, 100, 26, 0.38);
  background: #fff8df;
}

.quiz-option.selected-incorrect {
  border-color: rgba(184, 64, 64, 0.35);
  background: #fff0f0;
}

.quiz-option-prefix {
  font-weight: 900;
}

.quiz-option.selected-correct .quiz-option-prefix {
  color: var(--green);
}

.quiz-option.missed-correct .quiz-option-prefix {
  color: var(--amber);
}

.quiz-option.selected-incorrect .quiz-option-prefix {
  color: var(--red);
}

.quiz-assessment {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 12px 0 0;
}

.quiz-verdict.correct {
  color: var(--green);
}

.quiz-verdict.incorrect {
  color: var(--red);
}

.quiz-explanation {
  color: var(--grey-800);
}

.quiz-body {
  padding: 0 16px 16px;
}

.quiz-start-message {
  margin: 0;
  padding: 16px;
}

.quiz-submit-status {
  margin: 4px 0 10px;
  color: var(--grey-650);
  font-size: 14px;
  font-weight: 700;
}

.quiz-submit-status.is-ready {
  color: var(--green);
}

.quiz-result {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 16px 0;
  padding: 14px 16px;
  border-radius: 8px;
  background: var(--blue-100);
  color: var(--blue-900);
  font-weight: 900;
}

.quiz-result-needs-retry {
  color: var(--red);
  font-weight: 400;
}

.quiz-sequence-complete {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(35, 122, 81, 0.32);
  border-radius: 8px;
  background: #eef8f2;
  color: var(--green);
}

.quiz-sequence-complete span {
  color: var(--grey-800);
}

.planned-note,
.loading-state {
  padding: 22px;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--white);
  color: var(--grey-650);
}

.playground {
  margin: 28px auto 0;
  border: 1px solid var(--grey-300);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.playground-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--grey-200);
}

.playground-header h2 {
  margin: 0;
  color: var(--blue-900);
}

.playground-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.assignment-save-status {
  color: var(--grey-650);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.assignment-save-status[data-state="dirty"],
.assignment-save-status[data-state="saving"] {
  color: var(--amber);
}

.assignment-save-status[data-state="saved"] {
  color: var(--green);
}

.assignment-save-status[data-state="error"] {
  color: var(--red);
}

.playground-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  min-height: 430px;
}

.editor-pane,
.output-pane {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
}

.editor-pane {
  border-right: 1px solid var(--grey-200);
}

.editor-pane span,
.output-toolbar {
  padding: 10px 12px;
  border-bottom: 1px solid var(--grey-200);
  background: var(--grey-50);
  color: var(--grey-800);
  font-weight: 900;
}

#python-editor {
  width: 100%;
  min-height: 390px;
  resize: vertical;
  border: 0;
  padding: 16px;
  outline: none;
  color: #142235;
  background: #fbfcfe;
  font-size: 14px;
  line-height: 1.5;
}

.output-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

#python-output {
  min-height: 390px;
  padding: 16px;
  background: #121821;
  color: #eef5ff;
  font-size: 14px;
}

#python-output.error {
  color: #ffe6e6;
}

.terminal-input-form {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #2c3644;
  background: #121821;
  color: #eef5ff;
}

.terminal-input-form.is-disabled {
  color: #8b99aa;
}

.terminal-input-form label {
  color: #b8c7da;
  font-size: 12px;
  font-weight: 900;
}

.terminal-input-form.is-disabled label,
.terminal-input-form.is-disabled .terminal-input-row span {
  color: #6d7a8b;
}

.terminal-input-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.terminal-input-row span {
  color: #8fb7e4;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
  font-weight: 900;
}

.terminal-input-row input {
  width: 100%;
  border: 1px solid #3d4b5d;
  border-radius: 0;
  padding: 10px 11px;
  outline: none;
  background: #0d131c;
  color: #eef5ff;
  font-family: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

.terminal-input-row input:focus {
  border-color: #8fb7e4;
}

.terminal-input-row input:disabled {
  border-color: #283241;
  background: #111720;
  color: #6d7a8b;
}

.terminal-input-row button:disabled {
  cursor: default;
  opacity: 0.55;
}

@media (max-width: 920px) {
  .auth-panel {
    grid-template-columns: 1fr;
  }

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

  .workspace,
  .nav-collapsed .workspace {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    top: auto;
    height: auto;
    max-height: 360px;
    border-right: 0;
    border-bottom: 1px solid var(--grey-200);
  }

  .nav-collapsed .sidebar {
    display: none;
  }

  .main-panel {
    padding: 22px;
  }

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

  .editor-pane {
    border-right: 0;
    border-bottom: 1px solid var(--grey-200);
  }
}

@media (max-width: 760px) {
  .progress-dashboard {
    padding: 24px 16px;
  }

  .progress-header,
  .content-completion {
    display: grid;
  }

  .content-completion-action {
    justify-items: start;
  }

  .content-completion-action .action-feedback {
    text-align: left;
  }

  .progress-table-section {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  .progress-table-heading {
    padding: 0 0 14px;
    border-bottom: 0;
  }

  .progress-table-scroll {
    overflow: visible;
  }

  .progress-table,
  .progress-table tbody,
  .progress-table tr,
  .progress-table th,
  .progress-table td {
    display: block;
    width: 100%;
  }

  .progress-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .progress-table tbody {
    display: grid;
    gap: 14px;
  }

  .progress-table tbody tr {
    padding: 8px 14px;
    border: 1px solid var(--grey-300);
    border-radius: 8px;
    background: var(--white);
  }

  .progress-table th,
  .progress-table td {
    display: grid;
    grid-template-columns: minmax(90px, 0.38fr) minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
  }

  .progress-table th::before,
  .progress-table td::before {
    content: attr(data-label);
    grid-column: 1;
    grid-row: 1 / span 4;
    color: var(--grey-650);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.02em;
    text-transform: uppercase;
  }

  .progress-table th > *,
  .progress-table td > * {
    grid-column: 2;
  }

  .progress-table tbody tr:last-child th,
  .progress-table tbody tr:last-child td,
  .progress-table th,
  .progress-table td {
    border-bottom: 1px solid var(--grey-200);
  }

  .progress-table tbody tr > :last-child {
    border-bottom: 0;
  }

  .progress-chapter-title {
    min-width: 0;
  }
}

@media (max-width: 620px) {
  .auth-screen {
    padding: 16px;
  }

  .auth-panel {
    padding: 20px;
  }

  .auth-panel h1,
  .lesson-hero h1 {
    font-size: 30px;
  }

  .topbar {
    height: auto;
    min-height: 68px;
    flex-wrap: wrap;
    padding: 12px;
  }

  .user-email,
  .brand-subtitle {
    display: none;
  }

  .user-progress-menu {
    justify-items: start;
  }

  .progress-link-button {
    padding: 8px 2px;
  }

  .progress-header h1 {
    font-size: 30px;
  }

  .progress-metrics {
    grid-template-columns: 1fr;
  }

  .code-toolbar,
  .assignment-header,
  .quiz-header,
  .playground-header {
    display: grid;
  }

  .playground-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .quiz-header-actions {
    width: 100%;
    margin-left: 0;
    justify-content: flex-start;
  }

  .chapter-pager button {
    max-width: 100%;
    width: 100%;
  }
}
