@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/JetBrainsMono-Regular.woff2") format("woff2");
}

:root {
  color-scheme: light;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #111827;
  background: #f7f9fc;
  --page-background: #f7f9fc;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --text: #111827;
  --text-soft: #61708a;
  --line: #dfe5ee;
  --line-strong: #c8d1df;
  --blue: #0969ed;
  --blue-dark: #0757c7;
  --blue-soft: #eaf2ff;
  --green: #1fa84f;
  --green-soft: #e7f7ec;
  --font-code: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  --red: #c73737;
  --navy: #0c1a2d;
  --navy-hover: #152a45;
  --radius-large: 0.65rem;
  --radius-medium: 0.45rem;
  --shadow: 0 1px 3px rgb(15 23 42 / 7%);
  --content-width: 100rem;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 20rem;
  scroll-padding-top: 5rem;
}

body {
  display: flex;
  min-height: 100vh;
  margin: 0;
  flex-direction: column;
  color: var(--text);
  background: var(--page-background);
}

[hidden] {
  display: none !important;
}

a {
  color: var(--blue);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.16em;
  transition: color 130ms ease, background-color 130ms ease, border-color 130ms ease;
}

button,
input,
textarea {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-medium);
  font: inherit;
}

input,
textarea {
  width: 100%;
  padding: 0.72rem 0.85rem;
  color: var(--text);
  background: var(--surface);
}

button {
  min-height: 2.65rem;
  padding: 0.65rem 0.95rem;
  border-color: var(--blue);
  cursor: pointer;
  color: #ffffff;
  background: var(--blue);
  font-weight: 700;
  transition: color 130ms ease, background-color 130ms ease, border-color 130ms ease, box-shadow 130ms ease;
}

a:focus-visible,
button:focus-visible,
summary:focus-visible {
  outline: 3px solid #f1b544;
  outline-offset: 2px;
}

input:focus,
textarea:focus {
  outline: none;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100;
  padding: 0.7rem 1rem;
  border-radius: 0 0 var(--radius-medium) 0;
  color: #ffffff;
  background: var(--blue-dark);
  transform: translateY(-110%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: var(--navy);
  box-shadow: 0 1px 8px rgb(2 8 23 / 22%);
}

.topbar-shell {
  display: grid;
  width: 100%;
  max-width: var(--content-width);
  min-height: 4.6rem;
  margin: 0 auto;
  padding: 0 1.25rem;
  grid-template-columns: minmax(15rem, 1fr) auto minmax(15rem, 1fr);
  align-items: stretch;
  gap: 1rem;
}

.mobile-navigation-toggle,
.course-sidebar-primary,
.course-navigation-backdrop {
  display: none;
}

.site-brand {
  display: flex;
  align-self: center;
  align-items: center;
  justify-self: start;
  gap: 0.8rem;
  color: #ffffff;
  text-decoration: none;
}

.site-logo {
  display: block;
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 auto;
  object-fit: contain;
}

.brand-copy {
  display: grid;
  gap: 0.12rem;
}

.site-wordmark {
  display: block;
  width: 8.6rem;
  height: auto;
}

.site-navigation {
  display: flex;
  min-width: 0;
  align-items: stretch;
  justify-self: center;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.site-navigation::-webkit-scrollbar {
  display: none;
}

.site-navigation a {
  display: flex;
  min-height: 4.6rem;
  padding: 0 1.05rem;
  border-bottom: 3px solid transparent;
  align-items: center;
  flex: 0 0 auto;
  color: #e1e7f0;
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
}

.site-navigation a[aria-current="page"] {
  border-bottom-color: #2681ff;
  color: #4f9aff;
}

.account-menu-root {
  position: relative;
  display: flex;
  min-width: 0;
  margin-right: -1.25rem;
  align-items: stretch;
  justify-self: end;
}

.user-navigation {
  display: flex;
  min-width: 0;
  min-height: 0;
  padding: 0 1.25rem 0 0.85rem;
  border: 0;
  border-radius: 0;
  align-self: stretch;
  align-items: center;
  gap: 0.7rem;
  color: #ffffff;
  background: transparent;
  font-size: 0.93rem;
  font-weight: 650;
  text-decoration: none;
}

.user-navigation[aria-expanded="true"] {
  box-shadow: inset 0 -3px #2681ff;
}

.user-avatar {
  display: grid;
  width: 2.2rem;
  height: 2.2rem;
  border: 1px solid #347fdc;
  border-radius: 50%;
  place-items: center;
  color: #ffffff;
  background: #1d66c4;
  font-size: 0.76rem;
  font-weight: 800;
}

.user-name {
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chevron {
  width: 1rem;
  height: 1rem;
  color: #dbe3ef;
  transition: transform 130ms ease;
}

.user-navigation[aria-expanded="true"] .user-chevron {
  transform: rotate(180deg);
}

.account-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 70;
  width: min(30rem, calc(100vw - 1.5rem));
  overflow: hidden;
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 0.8rem 0.8rem;
  color: var(--text);
  background: #ffffff;
  box-shadow: 0 14px 40px rgb(15 23 42 / 18%);
}

.account-dropdown-body {
  padding: 1.25rem;
}

.login-link-label {
  flex: 0 0 auto;
  color: #25324a;
  font-size: 0.84rem;
  font-weight: 700;
}

.login-link-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 0.45rem;
}

.login-link-line {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 0.22rem;
  line-height: 1;
}

.login-link-value {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  color: #25324a;
  background: transparent;
  cursor: default;
  font-size: 0.84rem;
  font-weight: 400;
  line-height: 1;
  text-align: left;
  text-overflow: ellipsis;
  user-select: all;
  white-space: nowrap;
}

.login-link-value.is-loading {
  color: var(--text-soft);
}

.login-link-button {
  display: inline-flex;
  min-height: 2.25rem;
  padding: 0.4rem 0.65rem;
  border-color: var(--line-strong);
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: #25324a;
  background: #ffffff;
  font-size: 0.82rem;
  font-weight: 650;
}

.login-link-button svg {
  width: 1.1rem;
  height: 1.1rem;
  flex: 0 0 auto;
}

.logout-button svg {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
}

.rotate-link-button {
  width: 2.25rem;
  padding-inline: 0.4rem;
}

.account-menu-error {
  margin: 0.8rem 0 0;
  color: var(--red);
  font-size: 0.84rem;
}

.logout-form {
  padding: 0;
  border-top: 1px solid var(--line);
}

.logout-button {
  display: flex;
  width: 100%;
  min-height: 3.4rem;
  padding: 0.75rem 1.25rem;
  border: 0;
  border-radius: 0;
  align-items: center;
  justify-content: flex-start;
  gap: 0.65rem;
  color: #e11d2e;
  background: transparent;
  font-size: 0.98rem;
  font-weight: 700;
}

.topbar-spacer {
  min-width: 15rem;
}

.page-shell {
  flex: 1 0 auto;
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 1.25rem;
}

.site-footer {
  flex: 0 0 auto;
  background: var(--page-background);
}

.footer-shell {
  display: flex;
  width: 100%;
  max-width: var(--content-width);
  min-height: 4.25rem;
  margin: 0 auto;
  padding: 0.8rem 1.25rem;
  align-items: center;
  justify-content: flex-end;
}

.footer-shell a {
  color: var(--text-soft);
  font-size: 0.77rem;
  text-decoration: none;
}

.footer-shell a span {
  color: var(--blue);
  font-weight: 700;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  color: var(--text);
  line-height: 1.2;
}

h1 {
  margin: 0.3rem 0 0.75rem;
  font-size: clamp(1.8rem, 3.4vw, 2.8rem);
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

p {
  line-height: 1.55;
}

.welcome-card,
.auth-card,
.table-scroll,
.task-list-item a,
.task-description,
.preview-code {
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.welcome-card,
.auth-card {
  max-width: 44rem;
  padding: clamp(1.4rem, 3vw, 2.5rem);
}

.auth-card {
  max-width: 38rem;
}

.entrance-page-shell {
  max-width: 82rem;
  padding: 2.8rem 1.25rem 1.3rem;
}

.entrance-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  grid-template-columns: minmax(0, 1.12fr) minmax(25rem, 0.88fr);
  background: var(--surface);
  box-shadow: 0 8px 28px rgb(15 23 42 / 8%);
}

.entrance-introduction {
  min-width: 0;
  padding: 2.9rem 3.3rem 3.2rem;
  border-right: 1px solid var(--line);
}

.entrance-illustration {
  display: block;
  width: 100%;
  max-width: 38rem;
  height: 10.4rem;
  margin: -0.45rem 0 0.7rem;
  overflow: visible;
}

.entrance-illustration path,
.entrance-illustration circle,
.entrance-illustration rect {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.entrance-illustration .illustration-path {
  stroke: #cfe0f5;
  stroke-dasharray: 5 6;
  stroke-width: 2;
}

.entrance-illustration .illustration-dot {
  fill: #ffffff;
  stroke: #c9daef;
  stroke-width: 2;
}

.entrance-illustration .illustration-cross {
  stroke: #c9d7eb;
  stroke-width: 3;
}

.entrance-illustration .illustration-window {
  fill: #fbfdff;
  stroke: #b9cce6;
  stroke-width: 1.5;
}

.entrance-illustration .illustration-window-bar,
.entrance-illustration .illustration-line {
  stroke: #dce5f1;
  stroke-width: 6;
}

.entrance-illustration .illustration-red {
  fill: #f0323f;
  stroke: none;
}

.entrance-illustration .illustration-yellow {
  fill: #f4bf20;
  stroke: none;
}

.entrance-illustration .illustration-green {
  fill: #26b867;
  stroke: none;
}

.entrance-illustration .illustration-code {
  stroke: #1264ef;
  stroke-width: 5;
}

.entrance-illustration .illustration-braces {
  fill: #e7f2ff;
  stroke: #b9d3f4;
}

.entrance-illustration .illustration-braces + text {
  fill: #2b7ee8;
  font-family: var(--font-code);
  font-variant-ligatures: none;
  font-size: 21px;
}

.entrance-illustration .illustration-terminal {
  fill: #fff5ce;
  stroke: #f2cd63;
}

.entrance-illustration .illustration-terminal + path {
  fill: none;
  stroke: #7292bd;
  stroke-width: 2.5;
}

.entrance-introduction > h1 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 2.65rem);
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.entrance-introduction > h1 + .entrance-features {
  margin-top: 1.45rem;
}

.entrance-summary {
  max-width: 38rem;
  margin: 1.45rem 0 1.8rem;
  color: #40506c;
  font-size: 1rem;
  line-height: 1.5;
}

.entrance-features {
  display: grid;
  gap: 1rem;
}

.entrance-feature {
  display: grid;
  grid-template-columns: 3.4rem minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.entrance-feature-icon {
  display: grid;
  width: 3.4rem;
  height: 3.4rem;
  border: 1px solid;
  border-radius: 0.75rem;
  place-items: center;
}

.entrance-feature-icon svg {
  width: 1.8rem;
  height: 1.8rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.entrance-feature-icon.is-blue {
  border-color: #cfe0f7;
  color: #1264ef;
  background: #edf5ff;
}

.entrance-feature-icon.is-green {
  border-color: #c9eed7;
  color: #12a846;
  background: #ebfaf0;
}

.entrance-feature-icon.is-red {
  border-color: #f4d3d7;
  color: #e82234;
  background: #fff0f2;
}

.entrance-feature-icon.is-purple {
  border-color: #ddd3fb;
  color: #7147e8;
  background: #f3efff;
}

.entrance-feature h2 {
  margin: 0 0 0.18rem;
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.entrance-feature p {
  margin: 0;
  color: #40506c;
  font-size: 0.87rem;
  line-height: 1.45;
}

.entrance-actions {
  min-width: 0;
  padding: 3.25rem 3.7rem 3rem;
}

.entrance-heading h2 {
  margin: 0 0 1.8rem;
  font-size: 1.8rem;
  letter-spacing: -0.025em;
}

.entrance-form,
.resend-form {
  display: grid;
  gap: 1.05rem;
}

.entrance-form label,
.resend-form label {
  gap: 0.45rem;
  font-size: 0.9rem;
  font-weight: 750;
}

.entrance-input {
  position: relative;
  display: block;
}

.entrance-input input {
  min-height: 3.3rem;
  padding: 0.75rem 3rem 0.75rem 0.95rem;
  border-color: #cbd6e5;
  border-radius: 0.5rem;
  color: #24314a;
  font-size: 0.92rem;
}

.entrance-input input::placeholder {
  color: #99a6bb;
}

.entrance-input svg {
  position: absolute;
  top: 50%;
  right: 0.95rem;
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  pointer-events: none;
  stroke: #536b91;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.35;
  transform: translateY(-50%);
}

.entrance-submit,
.resend-button {
  display: flex;
  width: 100%;
  min-height: 3.55rem;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
}

.entrance-submit {
  margin-top: 0.3rem;
  border-color: #075cf0;
  border-radius: 0.55rem;
  background: linear-gradient(135deg, #075ff6, #0752dc);
  box-shadow: 0 5px 12px rgb(7 82 220 / 20%);
}

.entrance-submit svg,
.resend-button svg,
.entrance-security-note svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
}

.entrance-security-note {
  display: flex;
  margin: 1.15rem 0 0;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  color: #64738d;
  font-size: 0.81rem;
  line-height: 1.35;
  text-align: center;
}

.entrance-security-note svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.entrance-divider {
  display: grid;
  margin: 1.65rem 0;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1.1rem;
  color: #697792;
  font-size: 0.82rem;
}

.entrance-divider::before,
.entrance-divider::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.resend-card {
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: 0.6rem;
}

.resend-card > p:first-child {
  margin: 0 0 1rem;
  color: #3d4d68;
  font-size: 0.88rem;
  line-height: 1.5;
}

.resend-button {
  min-height: 3rem;
  border-color: #cbd6e5;
  border-radius: 0.5rem;
  color: #25324a;
  background: #ffffff;
  font-size: 0.9rem;
}

.entrance-message {
  margin: 0 0 1rem;
  font-size: 0.86rem;
}

.entrance-message:focus {
  outline: none;
}

.eyebrow {
  margin: 0 0 0.35rem;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.page-heading,
.preview-heading {
  max-width: 58rem;
  margin-bottom: 1.25rem;
}

.page-heading > :last-child,
.welcome-card > :last-child {
  margin-bottom: 0;
}

.form-stack,
.account-actions {
  display: grid;
  gap: 0.9rem;
  margin-top: 1.5rem;
}

.account-actions form,
.account-actions button {
  width: 100%;
}

label {
  display: grid;
  gap: 0.35rem;
  font-weight: 650;
}

.message {
  padding: 0.8rem 0.9rem;
  border-left: 3px solid var(--blue);
  border-radius: var(--radius-medium);
  background: var(--surface-subtle);
}

.message-error {
  border-left-color: var(--red);
  color: #ad2630;
  background: #fff0f2;
}

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

.message-success {
  border-left-color: var(--green);
  color: #16763a;
  background: var(--green-soft);
}

.completion-label,
.run-duration {
  color: var(--text-soft);
  font-size: 0.86rem;
}

.metadata-description,
.task-summary {
  margin: 0.2rem 0;
  color: var(--text-soft);
}

.breadcrumbs {
  display: flex;
  margin-bottom: 1.15rem;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.task-list {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.task-list-item a {
  display: grid;
  min-height: 4.25rem;
  padding: 0.8rem 1rem;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 0.85rem;
  color: inherit;
  text-decoration: none;
}

.task-list-item.is-completed a {
  border-left: 4px solid var(--green);
}

.task-number {
  color: var(--text-soft);
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  font-weight: 750;
}

.task-list-copy {
  display: grid;
  gap: 0.1rem;
}

.task-list-title {
  font-weight: 750;
}

.task-page-shell {
  max-width: var(--content-width);
  padding: 0.8rem 1rem;
}

.task-page-layout {
  display: grid;
  min-width: 0;
  min-height: calc(100vh - 9.65rem);
  grid-template-columns: 18.25rem minmax(0, 1fr);
  align-items: stretch;
  gap: 0.8rem;
}

.course-sidebar,
.task-workspace {
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.course-sidebar {
  position: sticky;
  top: 5.4rem;
  max-height: calc(100vh - 6.2rem);
  align-self: start;
  overflow-y: auto;
  padding: 0.65rem 0.55rem;
}

.sidebar-chapter summary {
  display: flex;
  min-height: 2.85rem;
  padding: 0.65rem 0.75rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  cursor: pointer;
  font-size: 0.91rem;
  font-weight: 750;
  list-style: none;
}

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

.sidebar-chapter summary svg {
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
  color: var(--text-soft);
  transition: transform 130ms ease;
}

.sidebar-chapter[open] summary svg {
  transform: rotate(180deg);
}

.sidebar-task-list {
  display: grid;
  gap: 0.18rem;
  margin: 0;
  padding: 0 0.2rem 0.55rem;
  list-style: none;
}

.sidebar-task a {
  display: grid;
  min-height: 2.55rem;
  padding: 0.52rem 0.65rem;
  border-radius: 0.38rem;
  grid-template-columns: 0.9rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.3;
  text-decoration: none;
}

.sidebar-task-status {
  display: grid;
  width: 0.82rem;
  height: 0.82rem;
  border: 1px solid #61708a;
  border-radius: 50%;
  place-items: center;
  color: #ffffff;
  font-size: 0.58rem;
  font-weight: 900;
}

.sidebar-task.is-completed .sidebar-task-status {
  border-color: var(--green);
  background: var(--green);
}

.sidebar-task.is-current a {
  color: var(--blue);
  background: var(--blue-soft);
  font-weight: 650;
}

.sidebar-task.is-current:not(.is-completed) .sidebar-task-status {
  border-color: var(--blue);
  background: var(--blue);
  box-shadow: 0 0 0 3px rgb(9 105 237 / 10%);
}

.task-workspace {
  min-width: 0;
  padding: 1.15rem 1.2rem 1.2rem;
}

.task-heading {
  padding: 0.05rem 0.5rem 0;
}

.task-title-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.task-title-row h1 {
  margin: 0;
  font-size: clamp(1.35rem, 2.2vw, 1.8rem);
  letter-spacing: -0.025em;
}

.task-summary {
  margin-top: 0.45rem;
  font-size: 0.9rem;
}

.task-workspace .task-description {
  margin: 1.15rem 0.5rem 1.5rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.task-description > :first-child,
.preview-code > :first-child {
  margin-top: 0;
}

.task-description > :last-child,
.preview-code > :last-child {
  margin-bottom: 0;
}

.python-behavior {
  margin: 1.25rem 0;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 0.28rem solid var(--blue);
}

.python-behavior-title {
  margin: 0.35rem 0 0.65rem;
  color: var(--blue-dark);
  font-size: 0.9rem;
  font-weight: 700;
}

.python-behavior > :last-child {
  margin-bottom: 0.35rem;
}

.task-description img {
  max-width: 100%;
  height: auto;
}

.task-description pre,
.result-panel pre {
  max-width: 100%;
  overflow: auto;
}

.task-description pre,
.task-description code {
  font-family: var(--font-code);
  font-variant-ligatures: none;
}

.task-description pre,
.task-description :not(pre) > code {
  font-size: 0.95em;
}

.task-description .tok-keyword,
.task-description .tok-meta {
  color: #7c3aed;
}

.task-description .tok-atom,
.task-description .tok-bool,
.task-description .tok-number {
  color: #b45309;
}

.task-description .tok-string,
.task-description .tok-string2 {
  color: #08783e;
}

.task-description .tok-definition,
.task-description .tok-propertyName,
.task-description .tok-typeName,
.task-description .tok-className {
  color: #0969da;
}

.task-description .tok-comment {
  color: #6b7280;
  font-style: italic;
}

.task-description .tok-invalid {
  color: var(--red);
}

.paste-guidance-dialog {
  width: min(29rem, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 18px 48px rgb(12 26 45 / 22%);
}

.paste-guidance-dialog::backdrop {
  background: rgb(12 26 45 / 38%);
  backdrop-filter: blur(1.5px);
}

.paste-guidance-content {
  padding: 1.35rem;
}

.paste-guidance-content h2 {
  margin: 0 0 0.65rem;
  font-size: 1.15rem;
}

.paste-guidance-content p {
  margin: 0;
  line-height: 1.55;
}

.paste-guidance-content .paste-guidance-note {
  margin-top: 0.75rem;
  color: var(--text-soft);
  font-size: 0.88rem;
}

.paste-guidance-content form {
  display: flex;
  margin-top: 1.1rem;
  justify-content: flex-end;
}

.editor-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.editor-toolbar {
  display: flex;
  min-height: 3rem;
  padding: 0 0.7rem 0 0;
  border-bottom: 1px solid var(--line);
  align-items: stretch;
  justify-content: space-between;
  gap: 0.75rem;
}

.editor-tab {
  display: flex;
  min-width: 5rem;
  padding: 0 0.65rem;
  border-bottom: 2px solid var(--blue);
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-size: 0.86rem;
  font-weight: 700;
}

.editor-reset,
.copy-output {
  display: inline-flex;
  min-height: auto;
  padding: 0.35rem 0.45rem;
  border-color: transparent;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 550;
}

.editor-reset {
  margin-right: -0.7rem;
  padding-inline: 0.75rem 0.9rem;
  border: 0;
  border-radius: 0;
  align-self: stretch;
}

.editor-reset svg,
.copy-output svg,
.run-button svg {
  width: 1.05rem;
  height: 1.05rem;
}

.code-editor-frame {
  --editor-initial-height: 16rem;
  min-width: 0;
  background: #ffffff;
}

.code-editor-frame.is-enhanced {
  height: var(--editor-initial-height);
  min-height: var(--editor-initial-height);
  overflow: hidden;
  resize: vertical;
}

.code-editor {
  min-height: var(--editor-initial-height);
  margin: 0;
  padding: 0.9rem 1rem;
  resize: vertical;
  border: 0;
  border-radius: 0;
  tab-size: 4;
  font-family: var(--font-code);
  font-variant-ligatures: none;
  font-size: 0.9rem;
  line-height: 1.55rem;
  white-space: pre;
}

.code-editor-mount,
.code-editor-mount .cm-editor {
  height: 100%;
}

.code-editor-mount .cm-editor {
  color: var(--text);
  background: #ffffff;
}

.code-editor-mount .cm-editor.cm-focused {
  outline: none;
}

.code-editor-mount .cm-scroller {
  overflow: auto;
  font-family: var(--font-code);
  font-variant-ligatures: none;
  font-size: 0.9rem;
  line-height: 1.55rem;
}

.code-editor-mount .cm-content {
  min-height: 100%;
  padding: 0.5rem 0;
  caret-color: var(--text);
}

.code-editor-mount .cm-line {
  padding: 0 0.25rem;
}

.code-editor-mount .cm-gutters {
  border-right: 1px solid #edf0f4;
  color: #8a94a6;
  background: #fbfcfe;
}

.code-editor-mount .cm-lineNumbers .cm-gutterElement {
  min-width: 2rem;
  padding: 0 1rem 0 0.35rem;
  font-size: 0.86rem;
}

.code-editor-mount .cm-foldGutter .cm-gutterElement {
  padding-right: 0.25rem;
}

.editor-actions {
  display: grid;
  min-height: 4.1rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--line);
  align-items: center;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 0.8rem;
}

.run-button {
  position: relative;
  display: inline-flex;
  width: 8.2rem;
  height: 2.65rem;
  min-width: 8.2rem;
  align-self: start;
  align-items: center;
  justify-content: center;
  gap: 0;
  box-shadow: 0 4px 10px rgb(9 105 237 / 20%);
}

.run-button svg {
  position: absolute;
  left: 1.75rem;
}

.run-button:not(.is-queued):not(.is-running) [data-run-button-label] {
  transform: translateX(0.12rem);
}

.run-button.is-queued svg,
.run-button.is-running svg {
  display: none;
}

.run-button.is-running {
  gap: 0.45rem;
}

.run-button.is-running::before {
  width: 1rem;
  height: 1rem;
  flex: 0 0 1rem;
  aspect-ratio: 1;
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: run-status-spin 700ms linear infinite;
  content: "";
}

.run-status {
  display: flex;
  min-height: 2.65rem;
  margin: 0;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 400;
}

.run-feedback {
  min-width: 0;
  align-self: start;
}

.run-feedback.is-passed .run-status {
  color: var(--green);
}

.run-feedback.is-passed .run-status,
.run-feedback.is-failed .run-status,
.run-feedback.is-timeout .run-status {
  font-weight: 650;
}

@keyframes run-status-spin {
  to {
    transform: rotate(360deg);
  }
}

.run-feedback.is-failed .run-status,
.run-feedback.is-timeout .run-status {
  color: #a15c00;
}

.run-feedback.is-program-error .run-status {
  color: var(--red);
}

.run-feedback.is-infrastructure_error .run-status,
.run-feedback.is-cancelled .run-status {
  color: var(--text-soft);
}

.run-feedback.is-passed .run-status::before,
.run-feedback.is-failed .run-status::before,
.run-feedback.is-timeout .run-status::before,
.run-feedback.is-infrastructure_error .run-status::before,
.run-feedback.is-cancelled .run-status::before {
  display: inline-grid;
  width: 1.55rem;
  height: 1.55rem;
  flex: 0 0 1.55rem;
  aspect-ratio: 1;
  margin-right: 0.65rem;
  border-radius: 50%;
  place-items: center;
  content: "✓";
  color: #ffffff;
  background: var(--green);
}

.run-feedback.is-failed .run-status::before {
  content: "!";
  background: #d97706;
}

.run-feedback.is-program-error .run-status::before {
  content: "";
  background:
    linear-gradient(45deg, transparent 42%, #ffffff 43% 57%, transparent 58%) center / 0.62rem 0.62rem no-repeat,
    linear-gradient(-45deg, transparent 42%, #ffffff 43% 57%, transparent 58%) center / 0.62rem 0.62rem no-repeat,
    var(--red);
}

.run-feedback.is-timeout .run-status::before {
  content: "…";
  background: #d97706;
}

.run-feedback.is-infrastructure_error .run-status::before {
  content: "!";
  background: var(--text-soft);
}

.run-feedback.is-cancelled .run-status::before {
  content: "";
  background:
    linear-gradient(45deg, transparent 42%, #ffffff 43% 57%, transparent 58%) center / 0.62rem 0.62rem no-repeat,
    linear-gradient(-45deg, transparent 42%, #ffffff 43% 57%, transparent 58%) center / 0.62rem 0.62rem no-repeat,
    var(--text-soft);
}

.run-metadata {
  display: flex;
  min-width: 5.5rem;
  align-self: stretch;
  align-items: center;
  justify-content: flex-end;
  gap: 0.8rem;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.run-metadata.has-feedback {
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0;
}

.run-metadata .exit-code {
  display: flex;
  min-height: 2.65rem;
  align-items: center;
}

.run-metadata .exit-code,
.run-metadata .run-duration {
  font-size: 0.85rem;
  line-height: 1.4;
}

.run-results {
  display: grid;
  margin-top: 0;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.result-panel {
  min-width: 0;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.task-workspace.has-run-results .editor-panel {
  border-bottom-right-radius: 0;
  border-bottom-left-radius: 0;
  box-shadow: none;
}

.task-workspace.has-run-results .result-panel {
  border-top: 0;
  border-radius: 0;
  box-shadow: none;
}

.run-results.has-output:not(.has-errors) .output-panel,
.run-results.has-errors .error-panel {
  border-radius: 0 0 var(--radius-large) var(--radius-large);
  box-shadow: var(--shadow);
}

.result-heading {
  display: flex;
  min-height: 2.1rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.result-heading h2 {
  margin: 0;
  font-size: 0.98rem;
}

.copy-output {
  min-height: 2rem;
  padding-inline: 0.6rem;
  border-color: var(--line);
  background: #ffffff;
}

.result-panel pre {
  max-height: 24rem;
  margin: 0.25rem 0 0;
  overflow-x: hidden;
  overflow-y: auto;
  color: var(--text);
  font-family: var(--font-code);
  font-variant-ligatures: none;
  font-size: 0.86rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
  scrollbar-gutter: stable;
  white-space: pre-wrap;
}

.error-panel pre {
  color: var(--red);
}

.exit-code {
  color: var(--text-soft);
  font-size: 0.78rem;
}

.exit-code.is-success {
  color: var(--green);
}

.feedback-list {
  display: grid;
  gap: 0;
  margin-top: -0.3rem;
  padding: 0 0 0 2.2rem;
  font-size: 0.85rem;
  line-height: 1.4;
  list-style: none;
}

.feedback-item {
  margin: 0;
}

.feedback-item a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.14em;
}

.feedback-item code {
  padding: 0.08em 0.3em;
  border-radius: 0.22rem;
  background: color-mix(in srgb, currentcolor 12%, transparent);
  font-family: var(--font-code);
  font-variant-ligatures: none;
  font-size: 0.92em;
  line-height: 1;
  vertical-align: 0.04em;
}

.run-feedback.is-failed:not(.is-program-error) .feedback-item {
  color: #a15c00;
}

.run-feedback.is-program-error .feedback-item {
  color: var(--red);
}

.feedback-hint,
.feedback-info {
  color: var(--text-soft);
}

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

.run-duration {
  text-align: right;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
}

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

.data-table th,
.data-table td {
  padding: 0.72rem 0.85rem;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  white-space: nowrap;
}

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

.data-table th {
  color: var(--text-soft);
  background: var(--surface-subtle);
  font-size: 0.82rem;
}

.table-secondary {
  color: var(--text-soft);
  font-size: 0.86rem;
}

.pagination {
  display: flex;
  margin-top: 1rem;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.preview-code,
.task-description:not(.task-workspace .task-description) {
  margin-top: 1rem;
  padding: 1.25rem;
}

.preview-code textarea {
  min-height: 20rem;
  margin-top: 0.75rem;
  resize: vertical;
  font-family: var(--font-code);
  font-variant-ligatures: none;
  line-height: 1.5;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (hover: hover) {
  a:hover {
    color: var(--blue-dark);
  }

  button:hover:not(:disabled) {
    border-color: var(--blue-dark);
    background: var(--blue-dark);
    box-shadow: 0 4px 12px rgb(9 105 237 / 24%);
  }

  input:hover,
  textarea:hover {
    border-color: var(--blue);
  }

  .site-brand:hover,
  .user-navigation:hover:not(:disabled),
  .mobile-navigation-toggle:hover:not(:disabled) {
    color: #ffffff;
  }

  .user-navigation:hover:not(:disabled),
  .mobile-navigation-toggle:hover:not(:disabled) {
    border-color: transparent;
    background: rgb(255 255 255 / 6%);
    box-shadow: none;
  }

  .user-navigation[aria-expanded="true"]:hover:not(:disabled) {
    box-shadow: inset 0 -3px #2681ff;
  }

  .copy-link-button:hover:not(:disabled),
  .rotate-link-button:hover:not(:disabled) {
    border-color: var(--line-strong);
    color: var(--blue-dark);
    background: var(--surface-subtle);
    box-shadow: none;
  }

  .login-link-value:hover:not(:disabled) {
    border-color: transparent;
    color: #25324a;
    background: transparent;
    box-shadow: none;
    text-decoration: none;
  }

  .entrance-submit:hover:not(:disabled) {
    border-color: #064dc9;
    background: linear-gradient(135deg, #0757df, #0648bd);
  }

  .resend-button:hover:not(:disabled) {
    border-color: #aebdd1;
    color: var(--blue-dark);
    background: var(--surface-subtle);
    box-shadow: none;
  }

  .logout-button:hover:not(:disabled) {
    border-color: transparent;
    color: #b91423;
    background: #fff4f4;
    box-shadow: none;
  }

  .site-navigation a:hover {
    color: #ffffff;
    background: var(--navy-hover);
  }

  .editor-reset:hover:not(:disabled),
  .copy-output:hover:not(:disabled) {
    color: var(--blue-dark);
    background: var(--surface-subtle);
    box-shadow: none;
  }

  .editor-reset:hover:not(:disabled) {
    border-color: transparent;
  }

  .copy-output:hover:not(:disabled) {
    border-color: var(--line-strong);
  }

  .task-list-item a:hover {
    border-color: #b9c5d6;
    color: inherit;
    background: #fbfdff;
    box-shadow: 0 4px 14px rgb(15 23 42 / 8%);
  }

  .sidebar-chapter summary:hover,
  .sidebar-task a:hover,
  .course-sidebar-primary a:hover {
    color: var(--blue-dark);
    background: #f2f6fc;
  }

  .sidebar-task.is-current a:hover {
    background: #dfebff;
  }

  .footer-shell a:hover {
    color: var(--blue-dark);
  }
}

@media (max-width: 82rem) {
  .entrance-page-shell {
    padding-top: 1.25rem;
  }
}

@media (max-width: 68rem) {
  .topbar-shell {
    grid-template-columns: minmax(12rem, 1fr) auto minmax(12rem, 1fr);
  }

  .task-page-layout {
    grid-template-columns: 16rem minmax(0, 1fr);
  }

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

  .entrance-introduction {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .entrance-actions {
    width: 100%;
    max-width: 42rem;
    margin: 0 auto;
  }
}

@media (max-width: 54rem) {
  .task-page-layout {
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
  }

  .course-sidebar {
    position: static;
    max-height: none;
  }

  .task-workspace {
    min-height: 40rem;
  }
}

@media (max-width: 44rem) {
  .topbar-shell {
    min-height: 3.9rem;
    padding-inline: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.45rem;
  }

  .topbar-shell.has-course-navigation {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .account-menu-root {
    margin-right: -0.75rem;
  }

  .user-navigation {
    padding-right: 0.75rem;
    padding-left: 0.6rem;
  }

  .has-course-navigation .mobile-navigation-toggle {
    display: flex;
    width: 2.75rem;
    min-height: 3.9rem;
    padding: 0.55rem;
    border: 0;
    border-radius: 0;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    background: transparent;
  }

  .mobile-navigation-toggle svg {
    display: block;
    width: 1.9rem;
    height: 1.9rem;
  }

  .mobile-navigation-close-icon {
    display: none;
  }

  .mobile-navigation-toggle[aria-expanded="true"] .mobile-navigation-burger-icon {
    display: none;
  }

  .mobile-navigation-toggle[aria-expanded="true"] .mobile-navigation-close-icon {
    display: block;
  }

  .has-course-navigation .site-navigation {
    display: none;
  }

  .site-logo {
    width: 2.25rem;
    height: 2.25rem;
  }

  .user-name,
  .user-chevron {
    display: none;
  }

  .site-wordmark {
    width: 7.2rem;
  }

  .site-navigation {
    justify-self: stretch;
    justify-content: center;
  }

  .site-navigation a {
    min-height: 3.9rem;
    padding-inline: 0.65rem;
    font-size: 0.88rem;
  }

  .topbar-spacer {
    min-width: 2.2rem;
  }

  .account-dropdown {
    position: fixed;
    top: 3.9rem;
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
  }

  .page-shell,
  .task-page-shell {
    padding: 0.75rem;
  }

  .entrance-card {
    border-radius: 0.65rem;
  }

  .entrance-introduction,
  .entrance-actions {
    padding: 1.4rem 1.15rem;
  }

  .entrance-illustration {
    height: 8rem;
    margin-bottom: 0.7rem;
  }

  .entrance-introduction > h1 {
    font-size: 2rem;
  }

  .entrance-introduction > h1 + .entrance-features {
    margin-top: 1rem;
  }

  .entrance-summary {
    margin: 1rem 0 1.35rem;
    font-size: 0.92rem;
  }

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

  .entrance-heading h2 {
    margin-bottom: 1.35rem;
    font-size: 1.65rem;
  }

  .resend-card {
    padding: 1rem;
  }

  body.course-navigation-open {
    overflow: hidden;
  }

  .course-sidebar {
    position: fixed;
    top: 3.9rem;
    bottom: 0;
    left: 0;
    z-index: 65;
    display: flex;
    width: min(20rem, calc(100vw - 3.25rem));
    max-height: none;
    padding: 0;
    overflow: hidden;
    border-width: 0 1px 0 0;
    border-radius: 0 0 var(--radius-large) 0;
    flex-direction: column;
    visibility: hidden;
    box-shadow: 8px 0 30px rgb(15 23 42 / 18%);
    transform: translateX(-105%);
    transition: transform 180ms ease, visibility 180ms ease;
  }

  .course-sidebar.is-open {
    visibility: visible;
    transform: translateX(0);
  }

  .course-sidebar-primary {
    display: grid;
    padding: 0.55rem;
    border-bottom: 1px solid var(--line);
    gap: 0.18rem;
  }

  .course-sidebar-primary a {
    display: flex;
    min-height: 2.65rem;
    padding: 0.65rem 0.75rem;
    border-radius: 0.38rem;
    align-items: center;
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
  }

  .course-sidebar-primary a[aria-current="page"] {
    color: var(--blue);
    background: var(--blue-soft);
  }

  .course-sidebar-curriculum {
    min-height: 0;
    padding: 0.65rem 0.55rem;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .course-navigation-backdrop {
    position: fixed;
    inset: 3.9rem 0 0;
    z-index: 60;
    display: block;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    visibility: hidden;
    opacity: 0;
    background: rgb(12 26 45 / 48%);
    cursor: default;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .course-navigation-backdrop.is-open {
    visibility: visible;
    opacity: 1;
  }

  .course-navigation-backdrop:hover:not(:disabled) {
    border: 0;
    background: rgb(12 26 45 / 48%);
    box-shadow: none;
  }

  .task-workspace {
    padding: 1rem 0.75rem 2.5rem;
  }

  .task-heading {
    padding-inline: 0.25rem;
  }

  .task-workspace .task-description {
    margin-inline: 0.25rem;
  }

  .task-list-item a {
    grid-template-columns: 1.5rem minmax(0, 1fr);
  }

  .completion-label {
    grid-column: 2;
  }

  .data-table th,
  .data-table td {
    padding: 0.6rem;
  }
}

@media (max-width: 36rem) {
  .editor-actions {
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.8rem;
    row-gap: 0.35rem;
  }

  .run-button {
    grid-row: 1;
    grid-column: 1;
  }

  .run-feedback {
    grid-row: 2;
    grid-column: 1 / -1;
  }

  .run-feedback .run-status {
    min-height: 0;
  }

  .editor-actions .run-feedback .run-status::before {
    display: none;
  }

  .run-feedback .feedback-list {
    margin-top: 0.15rem;
    padding-left: 0;
  }

  .run-metadata {
    min-width: 0;
    grid-row: 1;
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
  }

  .run-metadata.has-feedback {
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 0.8rem;
  }

  .editor-reset {
    margin-right: 0;
    padding-inline: 0.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .run-button.is-running::before {
    border-color: #ffffff;
    border-right-color: transparent;
    animation: none;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
