@import url("https://fonts.googleapis.com/css2?family=Fustat:wght@400;500;600;700;800&display=swap");
:root {
  font-family: Fustat, system-ui, sans-serif;
  color: #192a43;
  background: #f5f7fb;
  font-synthesis: none;
  --blue: #145ce6;
  --muted: #69778b;
  --line: #e2e8f1;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
textarea {
  font: inherit;
}
button,
a,
input,
textarea {
  -webkit-tap-highlight-color: transparent;
}
button,
a {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
a {
  color: inherit;
  text-decoration: none;
}
button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 11px;
  padding: 11px 17px;
  font-weight: 700;
  color: #243753;
}
button:hover {
  background: #eef3fc;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
:focus-visible {
  outline: 3px solid #79a5ff;
  outline-offset: 3px;
}
.shell {
  display: flex;
  min-height: 100vh;
}
.sidebar {
  width: 242px;
  position: fixed;
  inset: 0 auto 0 0;
  background: white;
  border-right: 1px solid var(--line);
  padding: 35px 22px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: -1px;
}
.brand > span:last-child {
  color: var(--blue);
}
.brand-icon {
  background: var(--blue);
  color: white;
  border-radius: 12px;
  width: 38px;
  height: 38px;
  margin-right: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.brand-icon span {
  font-size: 18px;
}
.workspace-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.3px;
  color: #8793a4;
  margin: 48px 8px 15px;
}
nav {
  display: grid;
  gap: 7px;
}
nav a {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 13px 14px;
  color: #64738b;
  border-radius: 10px;
  font-weight: 600;
}
nav a.active {
  background: #edf3ff;
  color: var(--blue);
}
.count {
  margin-left: auto;
  background: #dce8ff;
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
}
.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 25px 8px 0;
}
.edition,
.eyebrow {
  font-size: 11px;
  letter-spacing: 1.5px;
  font-weight: 800;
  color: var(--blue);
}
.sidebar-bottom p {
  font-weight: 700;
  line-height: 1.5;
}
.muted {
  color: var(--muted);
  font-size: 13px;
}
.main-wrap {
  margin-left: 242px;
  width: calc(100% - 242px);
}
.topbar {
  height: 82px;
  border-bottom: 1px solid var(--line);
  background: #ffffffb8;
  padding: 0 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
}
.crumb {
  color: #8a95a5;
  margin-left: 10px;
}
.profile {
  display: flex;
  gap: 10px;
  align-items: center;
}
.avatar {
  display: grid;
  place-items: center;
  width: 31px;
  height: 31px;
  background: #e5edfc;
  color: var(--blue);
  border-radius: 50%;
}
main {
  max-width: 1250px;
  margin: auto;
  padding: 42px;
}
h1 {
  font-size: 37px;
  letter-spacing: -1.3px;
  margin: 9px 0 12px;
  line-height: 1.12;
}
h2 {
  font-size: 23px;
  letter-spacing: -0.5px;
  margin: 0 0 10px;
}
h3 {
  font-size: 17px;
  margin: 0 0 8px;
}
p {
  line-height: 1.6;
  margin: 8px 0 18px;
}
.intro {
  color: var(--muted);
  max-width: 680px;
}
.welcome-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}
.pill {
  font-size: 12px;
  border: 1px solid var(--line);
  background: white;
  border-radius: 20px;
  padding: 7px 12px;
  white-space: nowrap;
}
.dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 290px;
  gap: 25px;
  margin-top: 28px;
}
.hero {
  background: #eaf1ff;
  border: 1px solid #d6e4ff;
  border-radius: 20px;
  padding: 30px;
  position: relative;
  overflow: hidden;
}
.hero h2 {
  font-size: 29px;
  max-width: 360px;
  margin: 16px 0 12px;
}
.hero p {
  color: #516787;
  max-width: 420px;
}
.primary {
  background: var(--blue);
  border-color: var(--blue);
  color: white;
}
.primary:hover {
  background: #0d4bc4;
}
.hero-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: #546a8a;
  margin-bottom: 23px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 23px;
}
.stack {
  display: grid;
  gap: 20px;
  align-content: start;
}
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 30px 0 17px;
}
.section-title h2 {
  font-size: 20px;
  margin: 0;
}
.lesson {
  display: flex;
  gap: 17px;
  align-items: center;
  background: white;
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 20px;
  margin-bottom: 12px;
}
.lesson.current {
  border-color: #a9c4ff;
  box-shadow: 0 3px 12px #145ce608;
}
.node {
  width: 46px;
  height: 46px;
  background: #edf3ff;
  color: var(--blue);
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-weight: 800;
  flex-shrink: 0;
}
.lesson-info {
  flex: 1;
}
.lesson-info p {
  font-size: 13px;
  color: var(--muted);
  margin: 4px 0 0;
}
.lesson button {
  font-size: 12px;
  padding: 9px 12px;
}
.stat {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.4;
}
.bar {
  height: 7px;
  border-radius: 10px;
  background: #eaf0f8;
  overflow: hidden;
  margin: 13px 0;
}
.bar span {
  display: block;
  height: 100%;
  background: var(--blue);
}
.callout {
  padding: 16px;
  background: #f5f8fd;
  border-radius: 12px;
  font-size: 14px;
  color: #526782;
}
.card small {
  color: var(--muted);
}
.mini-label {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.mini-icon {
  color: var(--blue);
  font-size: 22px;
  margin-bottom: 15px;
}
.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 24px;
  margin-top: 25px;
}
.exercise-card {
  padding: 30px;
}
.steps {
  display: flex;
  gap: 8px;
  margin: 20px 0;
}
.steps span {
  height: 5px;
  background: #e1e8f4;
  border-radius: 5px;
  flex: 1;
}
.steps span.on {
  background: var(--blue);
}
.equation {
  font-family: Georgia, serif;
  font-size: 37px;
  text-align: center;
  padding: 30px 10px;
  background: #f6f8fc;
  border: 1px solid #e7edf5;
  border-radius: 14px;
  margin: 20px 0;
  overflow-wrap: anywhere;
}
label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin: 18px 0 8px;
}
input,
textarea {
  width: 100%;
  border: 1px solid #ccd6e5;
  border-radius: 10px;
  background: white;
  padding: 13px;
  color: #192a43;
}
textarea {
  resize: vertical;
  min-height: 96px;
}
input {
  max-width: 100%;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}
.feedback {
  padding: 15px;
  border-radius: 11px;
  margin-top: 18px;
  line-height: 1.6;
  background: #fff5df;
  color: #78551c;
}
.feedback.good {
  background: #e9f7f0;
  color: #216344;
}
.feedback:empty {
  display: none;
}
.hint {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  font-size: 14px;
  line-height: 1.65;
}
.hint strong {
  color: var(--blue);
}
.empty {
  text-align: center;
  padding: 50px 25px;
}
.empty .mini-icon {
  font-size: 42px;
}
.note {
  border-top: 1px solid var(--line);
  padding: 18px 0;
}
.note p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.back {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  margin-bottom: 22px;
}
.back:hover {
  background: none;
  color: var(--blue);
}
.summary {
  max-width: 680px;
  margin: 30px auto;
}
.summary .stat {
  color: var(--blue);
}
footer {
  max-width: 1250px;
  margin: 20px auto;
  padding: 20px 42px;
  display: flex;
  gap: 18px;
  align-items: center;
  font-size: 11px;
  color: #7d8a9e;
  flex-wrap: wrap;
}
footer button {
  border: 0;
  background: none;
  font-size: 11px;
  padding: 0;
  color: #66768d;
}
footer > span {
  margin-left: auto;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 30px;
  max-width: 480px;
  width: calc(100% - 32px);
  color: #192a43;
}
dialog::backdrop {
  background: #12233c66;
}
.danger {
  color: #a62235;
}
.storage-warning {
  background: #fff0d5;
  padding: 12px;
  font-size: 13px;
}
.task-result {
  margin-top: 20px;
}
.check-list {
  padding-left: 21px;
  line-height: 1.9;
}
.save-status {
  font-size: 12px;
  color: #216344;
}
.task-examples {
  font-size: 13px;
  color: var(--muted);
}
@media (min-width: 1450px) {
  main {
    padding-top: 55px;
  }
}
@media (max-width: 1100px) {
  .sidebar {
    width: 205px;
    padding: 28px 15px;
  }
  .main-wrap {
    margin-left: 205px;
    width: calc(100% - 205px);
  }
  main {
    padding: 28px;
  }
  .dashboard,
  .lesson-layout {
    grid-template-columns: minmax(0, 1fr) 245px;
  }
  .topbar {
    padding: 0 28px;
  }
}
@media (max-width: 880px) {
  .dashboard,
  .lesson-layout {
    grid-template-columns: 1fr;
  }
  .dashboard > .stack {
    grid-template-columns: 1fr 1fr;
  }
  .welcome-row {
    align-items: flex-start;
  }
  .pill {
    display: none;
  }
  .sidebar {
    width: 180px;
  }
  .main-wrap {
    margin-left: 180px;
    width: calc(100% - 180px);
  }
  h1 {
    font-size: 32px;
  }
}
@media (max-width: 620px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: static;
    width: 100%;
    padding: 18px 18px 8px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    font-size: 23px;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
  }
  .workspace-label,
  .sidebar-bottom {
    display: none;
  }
  nav {
    display: flex;
    gap: 5px;
    margin-top: 16px;
    overflow-x: auto;
  }
  nav a {
    padding: 10px 8px;
    font-size: 12px;
    gap: 5px;
    white-space: nowrap;
  }
  .count {
    display: none;
  }
  .main-wrap {
    margin: 0;
    width: 100%;
  }
  .topbar {
    height: 53px;
    padding: 0 20px;
    font-size: 12px;
  }
  .crumb {
    margin-left: 3px;
  }
  .profile {
    font-size: 0;
  }
  .avatar {
    font-size: 13px;
  }
  main {
    padding: 26px 18px;
  }
  h1 {
    font-size: 30px;
  }
  .dashboard {
    margin-top: 20px;
  }
  .hero {
    padding: 24px;
  }
  .hero h2 {
    font-size: 25px;
  }
  .dashboard > .stack {
    grid-template-columns: 1fr;
  }
  .lesson {
    padding: 16px 12px;
    gap: 11px;
  }
  .lesson-info h3 {
    font-size: 15px;
  }
  .lesson button {
    padding: 8px;
    font-size: 11px;
  }
  .node {
    width: 36px;
    height: 40px;
    border-radius: 10px;
  }
  .exercise-card {
    padding: 20px;
  }
  .equation {
    font-size: 31px;
  }
  footer {
    padding: 20px 18px;
  }
  footer > span {
    margin-left: 0;
  }
  .actions button {
    flex-grow: 1;
  }
}
@media (prefers-reduced-motion: no-preference) {
  main {
    animation: arrive 0.25s ease-out;
  }
  @keyframes arrive {
    from {
      opacity: 0.4;
      transform: translateY(6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 24px 0;
}
.status-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  margin-bottom: 8px;
  background: #edf0f5;
  color: #627188;
}
.status-tag.published {
  background: #e8f5ee;
  color: #216344;
}
.admin-lesson {
  margin-top: 15px;
}
.admin-lesson .actions {
  margin: 0;
  justify-content: flex-end;
}
.admin-lesson small {
  color: var(--muted);
}
.question-editor {
  margin: 22px 0;
  min-width: 0;
}
.question-editor legend {
  font-size: 17px;
  font-weight: 800;
  padding: 0 9px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
}
.editor-save {
  position: sticky;
  bottom: 0;
  background: #f5f7fbf5;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.import-preview {
  margin: 22px 0;
}
.import-preview li {
  line-height: 1.8;
}
.import-preview summary {
  cursor: pointer;
  color: var(--blue);
  font-weight: 600;
}
.admin-lesson .lesson-info {
  min-width: 0;
  overflow-wrap: anywhere;
}
#content-list {
  margin-top: 20px;
}
@media (max-width: 900px) {
  .admin-lesson {
    flex-wrap: wrap;
  }
  .admin-lesson .actions {
    width: 100%;
    justify-content: flex-start;
  }
}
@media (max-width: 620px) {
  .editor-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .admin-toolbar button {
    flex: 1 1 40%;
  }
  .editor-save {
    position: static;
  }
}
select {
  font: inherit;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: #192a43;
}
#import-mode {
  width: 100%;
}
