:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #fff;
  --surface2: #f1f2f6;
  --text: #232737;
  --muted: #73798b;
  --line: #e6e8ef;
  --primary: #6254ce;
  --primary-hover: #5143bc;
  --lavender: #efedf9;
  --mint: #e4f2ed;
  --peach: #fbefe4;
  --shadow: 0 8px 30px #20253a08;
  --radius: 14px;
  font-family:
    Inter,
    ui-sans-serif,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 14px;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16191f;
  --surface: #1e222b;
  --surface2: #282d38;
  --text: #edf0f6;
  --muted: #a4abbd;
  --line: #333948;
  --primary: #a697f3;
  --primary-hover: #baaff8;
  --lavender: #302b45;
  --mint: #243c35;
  --peach: #413229;
  --shadow: 0 8px 30px #0002;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
textarea,
select {
  font: inherit;
}
button,
a,
input,
textarea,
select {
  touch-action: manipulation;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.45;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
button {
  color: inherit;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -1.1px;
  margin-bottom: 10px;
}
h2 {
  font-size: 21px;
  line-height: 1.35;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}
h3 {
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 8px;
}
p {
  color: var(--muted);
}
[hidden] {
  display: none !important;
}
.eyebrow,
.club-label,
.field-label {
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 1.8px;
  color: var(--muted);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 780;
  letter-spacing: -0.6px;
  line-height: 1.1;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary);
  color: var(--surface);
  font-family: ui-monospace, monospace;
  font-size: 20px;
  letter-spacing: -2px;
}
.brand-sub {
  display: block;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 3px;
  margin-top: 6px;
}
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 235px;
  padding: 32px 20px 20px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  z-index: 5;
}
.sidebar .brand {
  margin: 0 7px 48px;
}
.club-label {
  font-size: 9px;
  letter-spacing: 1.5px;
  margin: 0 14px 12px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  margin-bottom: 6px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 550;
  color: var(--muted);
}
.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}
.nav-item.active {
  background: var(--lavender);
  color: var(--primary);
}
.nav-icon {
  font-size: 20px;
  line-height: 1;
  width: 22px;
  text-align: center;
}
.sidebar-bottom {
  margin-top: auto;
}
.club-note {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  margin-bottom: 18px;
}
.club-note > span {
  font-size: 26px;
  color: var(--primary);
  display: block;
  margin-bottom: 9px;
}
.club-note strong {
  font-size: 12px;
}
.club-note p {
  font-size: 11px;
  margin: 6px 0 0;
}
.user-chip {
  display: flex;
  gap: 10px;
  align-items: center;
  border-top: 1px solid var(--line);
  margin-top: 12px;
  padding-top: 18px;
}
.avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  background: var(--lavender);
  border-radius: 12px;
  font-size: 22px;
  flex-shrink: 0;
}
.user-chip > div {
  min-width: 0;
}
.user-chip strong,
.user-chip span:not(.avatar) {
  display: block;
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 108px;
}
.user-chip > div > span {
  color: var(--muted);
  font-size: 10px;
}
.user-chip form {
  margin-left: auto;
}
.main {
  margin-left: 235px;
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 42px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  font-weight: 550;
  color: var(--muted);
}
.status-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 400;
}
.status-label i {
  width: 6px;
  height: 6px;
  display: block;
  background: #54a786;
  border-radius: 50%;
  flex-shrink: 0;
}
.page-content {
  padding: 38px 42px;
  max-width: 1430px;
  margin: 0 auto;
}
.page-content.narrow {
  max-width: 800px;
  margin-left: 0;
}
.page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 30px;
}
.page-heading .eyebrow {
  margin-bottom: 12px;
}
.page-heading p {
  font-size: 13px;
  margin-bottom: 0;
}
.wave {
  font-size: 28px;
  margin-left: 7px;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 11px 17px;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.5;
  white-space: nowrap;
  transition: background 0.15s;
}
.button.primary {
  background: var(--primary);
  color: var(--surface);
}
.button.primary:hover {
  background: var(--primary-hover);
}
.button.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
}
.button.secondary:hover {
  background: var(--surface2);
}
.button.full {
  width: 100%;
  justify-content: space-between;
}
.button.small {
  font-size: 11px;
  padding: 7px 12px;
}
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 6px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}
.icon-button:hover {
  background: var(--surface2);
  color: var(--text);
}
.quiet {
  background: none;
  border: 0;
  padding: 5px 0;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
}
.theme-toggle.quiet {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
}
.quiet:hover,
.text-link:hover {
  color: var(--primary);
}
.text-link {
  font-size: 12px;
  color: var(--primary);
}
.hero {
  background: var(--lavender);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 38px;
  min-height: 280px;
  overflow: hidden;
}
.pill {
  font-size: 10px;
  display: inline-block;
  padding: 4px 9px;
  border-radius: 5px;
  background: var(--surface2);
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}
.hero .pill {
  color: var(--primary);
  background: var(--surface);
  font-size: 9px;
  letter-spacing: 1.1px;
  margin-bottom: 16px;
}
.hero h2 {
  font-size: 30px;
  line-height: 1.22;
  letter-spacing: -1px;
  margin-bottom: 13px;
}
.hero p {
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 21px;
}
.hero-illustration {
  position: relative;
  width: 340px;
  height: 225px;
  flex-shrink: 0;
}
.mini-browser {
  position: absolute;
  left: 25px;
  top: 25px;
  width: 270px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 9px 12px 0 #6254ce18;
  transform: rotate(-3deg);
  overflow: hidden;
}
.mini-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 28px;
  border-bottom: 1px solid var(--line);
  padding: 0 10px;
  background: var(--bg);
}
.mini-bar i {
  width: 5px;
  height: 5px;
  background: #c7c4d6;
  border-radius: 50%;
}
.mini-bar span {
  font-size: 7px;
  color: var(--muted);
  margin-left: 38px;
}
.mini-content {
  text-align: center;
  padding: 20px;
}
.mini-content > span {
  display: block;
  font-size: 28px;
  color: #d69747;
}
.mini-content strong {
  font-size: 20px;
  letter-spacing: -0.6px;
}
.mini-content p {
  font-size: 9px;
  margin: 4px 0 13px;
}
.mini-button {
  display: inline-block;
  background: var(--primary);
  color: var(--surface);
  padding: 6px 12px;
  border-radius: 5px;
  font-size: 8px;
}
.floating-bracket {
  position: absolute;
  top: 12px;
  right: 0;
  font-size: 40px;
  font-family: monospace;
  color: var(--primary);
  transform: rotate(13deg);
}
.floating-star {
  position: absolute;
  bottom: 10px;
  left: 0;
  font-size: 44px;
  color: #5b9a7e;
}
.floating-label {
  position: absolute;
  right: 10px;
  bottom: 0;
  font-size: 9px;
  padding: 5px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  transform: rotate(3deg);
}
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 30px 0 20px;
}
.section-heading h2 {
  font-size: 20px;
  margin-bottom: 5px;
}
.section-heading p {
  font-size: 12px;
  margin-bottom: 0;
}
.section-heading > .muted {
  font-size: 11px;
}
.count {
  font-size: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 7px;
  margin-left: 7px;
  vertical-align: middle;
}
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.lesson-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.card-art {
  height: 145px;
  background: var(--mint);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.card-art > span:first-child {
  font-size: 40px;
}
.art-code {
  font-family: ui-monospace, monospace;
  font-size: 9px;
  color: #58776a;
}
.card-art.art-1 {
  background: var(--peach);
}
.card-art.art-2 {
  background: var(--lavender);
}
.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--surface);
  font-size: 9px;
}
.card-body {
  padding: 20px;
}
.card-meta {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 10px;
}
.card-meta > span {
  padding: 0 5px;
}
.card-body h3 {
  font-size: 17px;
  margin-bottom: 8px;
}
.card-body p {
  font-size: 12px;
  min-height: 40px;
  margin-bottom: 18px;
}
.progress-track {
  height: 3px;
  background: var(--surface2);
  border-radius: 2px;
  margin-bottom: 18px;
  overflow: hidden;
}
.progress-fill {
  background: var(--primary);
  height: 100%;
}
.progress-0 {
  width: 0;
}
.progress-5 {
  width: 5%;
}
.progress-10 {
  width: 10%;
}
.progress-15 {
  width: 15%;
}
.progress-20 {
  width: 20%;
}
.progress-25 {
  width: 25%;
}
.progress-30 {
  width: 30%;
}
.progress-35 {
  width: 35%;
}
.progress-40 {
  width: 40%;
}
.progress-45 {
  width: 45%;
}
.progress-50 {
  width: 50%;
}
.progress-55 {
  width: 55%;
}
.progress-60 {
  width: 60%;
}
.progress-65 {
  width: 65%;
}
.progress-70 {
  width: 70%;
}
.progress-75 {
  width: 75%;
}
.progress-80 {
  width: 80%;
}
.progress-85 {
  width: 85%;
}
.progress-90 {
  width: 90%;
}
.progress-95 {
  width: 95%;
}
.progress-100 {
  width: 100%;
}
.card-link {
  display: flex;
  justify-content: space-between;
  color: var(--primary);
  font-size: 12px;
  font-weight: 650;
  border-top: 1px solid var(--line);
  padding-top: 15px;
}
.card-link span {
  font-size: 17px;
}
.friendly-note {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 35px;
  padding: 20px 24px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}
.friendly-note > span {
  font-size: 24px;
}
.friendly-note strong {
  font-size: 12px;
}
.friendly-note p {
  font-size: 11px;
  margin: 3px 0 0;
}
.notice {
  padding: 12px 16px;
  border: 1px solid #77b79e55;
  border-radius: 9px;
  background: var(--mint);
  font-size: 12px;
  margin-bottom: 24px;
}
.notice.error {
  background: var(--peach);
  border-color: #d5887355;
}
.muted {
  color: var(--muted);
}
.empty-state {
  text-align: center;
  padding: 35px;
}
.empty-state > span {
  font-size: 32px;
}
.empty-state h3 {
  font-size: 16px;
  margin: 12px 0 4px;
}
.empty-state p {
  font-size: 12px;
  margin-bottom: 0;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow);
}
label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 18px;
}
input:not([type="checkbox"]):not([type="radio"]),
textarea,
select {
  display: block;
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 11px 12px;
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.6;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
  font-weight: 400;
}
textarea {
  resize: vertical;
}
input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--primary);
}
.form-row {
  display: flex;
  gap: 20px;
  align-items: center;
}
.form-row > label {
  flex: 1;
  min-width: 0;
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 20px;
}
.form-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}
fieldset {
  border: 0;
  margin: 0 0 24px;
  padding: 0;
}
legend {
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
}
.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.avatar-option {
  margin: 0;
  position: relative;
}
.avatar-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
}
.avatar-option > span {
  display: grid;
  place-items: center;
  background: var(--bg);
  border: 2px solid var(--line);
  border-radius: 13px;
  height: 70px;
  font-size: 34px;
  cursor: pointer;
}
.avatar-option input:checked + span {
  border-color: var(--primary);
  background: var(--lavender);
}
.avatar-option input:focus-visible + span {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 34px;
}
.stat-card {
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.stat-icon {
  width: 45px;
  height: 45px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 25px;
}
.violet {
  background: var(--lavender);
  color: var(--primary);
}
.mint {
  background: var(--mint);
  color: #57947b;
}
.peach {
  background: var(--peach);
  color: #a8774f;
}
.stat-card strong {
  display: block;
  font-size: 26px;
  font-weight: 650;
  line-height: 1.3;
}
.stat-card div > span {
  font-size: 11px;
  color: var(--muted);
}
.table-panel {
  padding: 0;
}
.table-scroll {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
th {
  background: var(--bg);
  color: var(--muted);
  font-size: 10px;
  font-weight: 550;
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
}
th:first-child {
  border-top-left-radius: 12px;
}
th:last-child {
  border-top-right-radius: 12px;
}
td {
  padding: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
tr:last-child td {
  border-bottom: 0;
}
.student-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}
.student-cell strong,
.student-cell div > span {
  display: block;
  white-space: nowrap;
}
.student-cell div > span {
  color: var(--muted);
  font-size: 10px;
}
.project-link {
  display: block;
  font-size: 11px;
  margin: 5px 0;
  color: var(--primary);
}
.project-link span {
  display: block;
  font-size: 10px;
  color: var(--muted);
}
.success {
  background: var(--mint);
  color: #4e9273;
}
html[data-theme="dark"] .success {
  color: #8bc7ac;
}
.manage-menu summary {
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}
.manage-content {
  min-width: 190px;
  display: grid;
  gap: 9px;
  padding-top: 15px;
}
.manage-content label {
  margin-bottom: 10px;
  font-size: 10px;
}
.manage-content input {
  padding: 7px !important;
  font-size: 11px !important;
}
.danger-text,
.button.danger-text {
  color: #bd5c58;
}
.admin-lessons {
  display: grid;
  gap: 12px;
}
.admin-lesson {
  display: flex;
  gap: 17px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 18px 20px;
}
.lesson-symbol {
  width: 44px;
  height: 44px;
  background: var(--lavender);
  display: grid;
  place-items: center;
  font-family: monospace;
  font-weight: 650;
  color: var(--primary);
  border-radius: 10px;
}
.admin-lesson-copy {
  flex: 1;
}
.admin-lesson-copy h3 {
  font-size: 14px;
  margin-bottom: 4px;
}
.admin-lesson-copy p {
  font-size: 10px;
  margin: 0;
}
dialog {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 28px;
  width: min(440px, calc(100vw - 32px));
  box-shadow: 0 20px 80px #0003;
}
dialog::backdrop {
  background: #161a2766;
}
.dialog-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.dialog-heading h2 {
  font-size: 20px;
  margin: 0;
}
dialog > p {
  font-size: 12px;
  margin-bottom: 25px;
}
.assignment-list {
  margin-bottom: 24px;
}
.assignment-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.assignment-row .muted {
  font-weight: 400;
  font-size: 11px;
}
.step-editor-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}
.step-editor-tabs button {
  background: var(--surface);
  color: var(--muted);
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}
.step-editor-tabs button.active {
  color: var(--primary);
  background: var(--lavender);
  border-color: var(--primary);
}
.markdown-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.markdown-editor textarea,
.code-input {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  tab-size: 2;
}
.markdown-preview {
  border-left: 1px solid var(--line);
  padding-left: 24px;
  min-width: 0;
  max-height: 600px;
  overflow: auto;
}
.field-label {
  margin-bottom: 16px;
}
.markdown {
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.markdown h1 {
  font-size: 26px;
  line-height: 1.35;
  margin: 0 0 20px;
}
.markdown h2 {
  font-size: 21px;
  margin: 24px 0 10px;
}
.markdown h3 {
  font-size: 17px;
}
.markdown p {
  color: var(--text);
  margin-bottom: 18px;
}
.markdown pre {
  padding: 16px;
  background: var(--surface2);
  border: 1px solid var(--line);
  border-radius: 9px;
  white-space: pre;
  overflow: auto;
  font-size: 12px;
  line-height: 1.8;
}
.markdown code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.9em;
  background: var(--surface2);
  padding: 2px 4px;
  border-radius: 4px;
}
.markdown pre code {
  padding: 0;
  background: none;
}
.markdown a {
  color: var(--primary);
  text-decoration: underline;
}
.markdown img {
  max-width: 100%;
  border-radius: 8px;
}
.markdown blockquote {
  margin: 18px 0;
  border-left: 3px solid var(--primary);
  padding: 4px 16px;
  background: var(--lavender);
}
.markdown blockquote p {
  margin: 5px 0;
}
.markdown table {
  font-size: 12px;
}
.step-order-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.starter-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.starter-toolbar label {
  width: 300px;
}
.small-copy {
  font-size: 11px;
  margin: 10px 0 0;
}
.login-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}
.login-story {
  background: var(--lavender);
  display: flex;
  flex-direction: column;
  padding: 42px 55px;
  position: relative;
}
.story-content {
  margin: auto 0;
  padding: 55px 0;
}
.story-content .eyebrow {
  color: var(--primary);
}
.story-content h1 {
  font-size: 48px;
  letter-spacing: -2px;
  margin: 22px 0;
  line-height: 1.16;
}
.story-content > p {
  font-size: 14px;
  line-height: 1.8;
}
.story-footer {
  font-size: 10px;
  color: var(--muted);
}
.code-art {
  border: 1px solid var(--line);
  border-radius: 11px;
  max-width: 420px;
  background: var(--surface);
  margin-top: 35px;
  position: relative;
  box-shadow: 8px 8px 0 #6254ce12;
}
.art-dots {
  padding: 10px 14px;
  font-size: 9px;
  color: #bab8cf;
  border-bottom: 1px solid var(--line);
  letter-spacing: 3px;
}
.art-dots span {
  font-size: 9px;
  letter-spacing: 0;
  float: right;
  color: var(--muted);
}
.code-art pre {
  padding: 16px;
  font-size: 10px;
  white-space: pre-wrap;
  color: var(--text);
  line-height: 1.8;
  overflow-wrap: anywhere;
}
.code-art pre > span {
  color: var(--primary);
}
.art-sticker {
  position: absolute;
  right: -20px;
  bottom: -20px;
  font-size: 38px;
  transform: rotate(12deg);
}
.login-main {
  display: grid;
  place-items: center;
  background: var(--surface);
  padding: 45px;
  position: relative;
}
.login-theme {
  position: absolute;
  top: 28px;
  right: 28px;
}
.login-form {
  width: 100%;
  max-width: 340px;
}
.welcome-icon {
  display: block;
  font-size: 36px;
  margin-bottom: 20px;
}
.login-form h2 {
  font-size: 28px;
  letter-spacing: -0.8px;
}
.login-form > p {
  font-size: 12px;
  margin-bottom: 30px;
}
.login-form label {
  font-size: 12px;
  margin-bottom: 20px;
}
.login-form .button {
  margin-top: 7px;
  padding: 13px 17px;
}
.login-help {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 22px;
}
.login-privacy {
  font-size: 10px;
  color: var(--muted);
  margin-top: 50px;
  text-align: center;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.error-page {
  max-width: 700px;
  margin: 60px auto;
  padding: 24px;
}
.error-page > .brand {
  margin-bottom: 35px;
}
.error-page h1 {
  font-size: 25px;
}
.error-page p {
  margin-bottom: 24px;
}
.lesson-shell {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.lesson-topbar {
  height: 65px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.lesson-topbar > .back-link {
  font-size: 24px;
  color: var(--muted);
}
.lesson-title {
  flex: 1;
  min-width: 0;
}
.lesson-title strong {
  font-size: 13px;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lesson-title > span {
  font-size: 10px;
  color: var(--muted);
  display: block;
}
.split-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}
.instructions {
  width: 360px;
  min-width: 240px;
  max-width: 65%;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  flex-shrink: 0;
}
.instructions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px 10px;
}
.step-indicators {
  display: flex;
  gap: 10px;
  padding: 4px 24px 20px;
  overflow-x: auto;
}
.step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.step-dot.active {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--surface);
}
.step-dot.past {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--lavender);
}
.instruction-scroll {
  flex: 1;
  overflow: auto;
  padding: 12px 24px 20px;
}
.step-caption {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 23px;
}
.step-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 18px 24px;
  border-top: 1px solid var(--line);
}
.lesson-complete {
  font-size: 11px;
  background: var(--mint);
  padding: 14px 24px;
}
.resize-handle,
.workspace-resize-handle {
  width: 6px;
  flex-shrink: 0;
  background: var(--line);
  cursor: col-resize;
  position: relative;
}
.resize-handle:hover,
.resize-handle:focus,
.workspace-resize-handle:hover,
.workspace-resize-handle:focus {
  background: var(--primary);
}
.resize-handle:after,
.workspace-resize-handle:after {
  content: "⋮";
  position: absolute;
  top: 48%;
  left: 0;
  font-size: 11px;
  color: var(--muted);
}
.workspace {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
}
.workspace-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 47px;
  flex-wrap: wrap;
  flex-shrink: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  gap: 5px;
  padding: 0 12px;
}
.workspace-tabs {
  display: flex;
  align-self: stretch;
  gap: 14px;
  min-height: 46px;
}
.workspace-tab {
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  padding: 0 6px;
  font-size: 11px;
  white-space: nowrap;
}
.workspace-tab.active {
  border-bottom-color: var(--primary);
  color: var(--primary);
}
.workspace-actions {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
  min-height: 34px;
}
.workspace-actions .icon-button {
  font-size: 18px;
  width: 27px;
}
.editor-popout {
  display: flex;
  align-items: center;
  height: 28px;
  padding: 0 8px;
  font-size: 11px;
  white-space: nowrap;
  border: 1px solid var(--line);
  border-radius: 7px;
}
.editor-popout:hover {
  background: var(--lavender);
  color: var(--primary);
}
.iframe-area {
  position: relative;
  flex: 1;
  min-height: 0;
  background: var(--surface2);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
}
.workspace-loading {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 16px;
  padding: 32px;
  text-align: center;
  background: var(--surface2);
}
.workspace-loading h1,
.workspace-loading h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.5px;
}
.workspace-loading p {
  max-width: 360px;
  margin: 0;
  color: var(--muted);
}
.workspace-spinner {
  width: 42px;
  height: 42px;
  border: 4px solid var(--line);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: workspace-spin 1s linear infinite;
}
@keyframes workspace-spin {
  to {
    transform: rotate(360deg);
  }
}
.workspace-start-page {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.workspace-loading-card {
  position: static;
  width: min(100%, 480px);
  min-height: 320px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.iframe-area iframe {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  grid-row: 1;
  border: 0;
}
.iframe-area.workspace-split {
  grid-template-columns: minmax(0, var(--editor-share, 60%)) 6px minmax(0, 1fr);
}
.workspace-split #editor-frame {
  grid-column: 1;
}
.workspace-split .workspace-resize-handle {
  grid-column: 2;
  grid-row: 1;
}
.workspace-split #preview-frame {
  grid-column: 3;
}
.workspace-footer {
  height: 25px;
  flex-shrink: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  color: var(--muted);
  font-size: 9px;
  border-top: 1px solid var(--line);
}
.green-dot {
  color: #54a786;
  padding-left: 4px;
}
.instructions-collapsed .instructions,
.instructions-collapsed .resize-handle {
  display: none;
}
.dragging iframe,
.resizing-workspace iframe {
  pointer-events: none;
}
.dragging,
.resizing-workspace {
  user-select: none;
}
.fullscreen-workspace .instructions,
.fullscreen-workspace .resize-handle,
.fullscreen-workspace .lesson-topbar {
  display: none;
}
.back-link {
  font-size: 12px;
  color: var(--primary);
}
@media (min-width: 1600px) {
  .login-story {
    padding-left: 90px;
    padding-right: 90px;
  }
  .story-content h1 {
    font-size: 58px;
  }
  .page-content {
    padding-top: 48px;
  }
  .hero {
    padding: 42px;
  }
}
@media (max-width: 1200px) {
  .sidebar {
    width: 205px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .main {
    margin-left: 205px;
  }
  .page-content {
    padding: 30px;
  }
  .topbar {
    padding: 0 30px;
  }
  .hero {
    padding: 28px;
  }
  .hero-illustration {
    width: 280px;
    transform: scale(0.85);
    transform-origin: center;
  }
  .hero h2 {
    font-size: 27px;
  }
  .lesson-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .admin-lesson {
    gap: 12px;
  }
  .story-content h1 {
    font-size: 40px;
  }
  .login-story {
    padding: 35px;
  }
  .instructions {
    width: 330px;
  }
  .workspace-tabs {
    gap: 6px;
  }
}
@media (max-width: 900px) {
  .hero-illustration {
    display: none;
  }
  .hero {
    min-height: 260px;
  }
  .stats-grid {
    gap: 10px;
  }
  .stat-card {
    padding: 15px;
    gap: 10px;
  }
  .stat-icon {
    width: 35px;
    height: 35px;
    font-size: 20px;
  }
  .stat-card strong {
    font-size: 23px;
  }
  .admin-lesson {
    flex-wrap: wrap;
  }
  .admin-lesson-copy {
    min-width: 150px;
  }
  .markdown-editor {
    grid-template-columns: 1fr;
  }
  .markdown-preview {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 20px 0 0;
  }
  .form-row {
    flex-wrap: wrap;
  }
  .step-order-actions {
    margin-bottom: 15px;
  }
  .login-layout {
    grid-template-columns: 45% 55%;
  }
  .login-story {
    padding: 30px;
  }
  .story-content h1 {
    font-size: 34px;
  }
  .code-art {
    display: none;
  }
  .login-main {
    padding: 30px;
  }
  .lesson-topbar .status-label {
    font-size: 10px;
  }
  .instructions {
    width: 300px;
  }
  .workspace-toolbar {
    padding: 0 5px;
  }
  .workspace-tab {
    font-size: 10px;
  }
  .workspace-actions {
    gap: 0;
  }
}
@media (max-width: 900px) {
  .iframe-area.workspace-split {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: minmax(0, var(--editor-share, 60%)) 6px minmax(0, 1fr);
  }
  .workspace-split .workspace-resize-handle {
    grid-column: 1;
    grid-row: 2;
    width: 100%;
    cursor: row-resize;
  }
  .workspace-split .workspace-resize-handle:after {
    content: "⋯";
    top: -7px;
    left: 48%;
  }
  .workspace-split #preview-frame {
    grid-column: 1;
    grid-row: 3;
  }
}
@media (max-width: 680px) {
  .sidebar {
    position: relative;
    width: 100%;
    height: auto;
    padding: 15px 20px;
    border-bottom: 1px solid var(--line);
    border-right: 0;
    flex-direction: row;
    align-items: center;
    gap: 15px;
  }
  .sidebar .brand {
    margin: 0;
    font-size: 16px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }
  .brand-sub {
    font-size: 7px;
    letter-spacing: 2px;
  }
  .club-label,
  .sidebar-bottom,
  .sidebar .nav-icon {
    display: none;
  }
  .sidebar nav {
    display: flex;
    margin-left: auto;
    gap: 5px;
  }
  .nav-item {
    padding: 7px 9px;
    font-size: 10px;
    margin: 0;
  }
  .sidebar nav a.nav-create {
    display: none;
  }
  .main {
    margin-left: 0;
  }
  .topbar {
    min-height: 48px;
    padding: 0 20px;
    font-size: 10px;
  }
  .topbar .status-label {
    font-size: 9px;
  }
  .page-content {
    padding: 25px 20px;
  }
  .page-heading {
    align-items: flex-start;
    margin-bottom: 25px;
    gap: 12px;
  }
  .page-heading h1 {
    font-size: 26px;
  }
  .page-heading .button {
    font-size: 10px;
    padding: 8px 10px;
  }
  .page-heading p {
    font-size: 12px;
  }
  .eyebrow {
    font-size: 8px;
  }
  .hero {
    padding: 25px;
    min-height: 255px;
  }
  .hero h2 {
    font-size: 27px;
  }
  .hero p br {
    display: none;
  }
  .lesson-grid {
    grid-template-columns: 1fr;
  }
  .card-art {
    height: 160px;
  }
  .section-heading > .muted {
    display: none;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
  .stat-card {
    padding: 15px 20px;
  }
  .stat-card div {
    display: flex;
    align-items: center;
    gap: 14px;
  }
  .stats-grid {
    margin-bottom: 25px;
  }
  .admin-lesson {
    padding: 15px;
  }
  .admin-lesson .pill {
    margin-left: auto;
  }
  .friendly-note {
    padding: 18px;
  }
  .table-scroll td {
    padding: 15px;
  }
  .table-scroll th {
    padding: 12px 15px;
  }
  .login-layout {
    display: block;
  }
  .login-story {
    padding: 22px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
  }
  .story-content,
  .story-footer {
    display: none;
  }
  .login-main {
    min-height: calc(100dvh - 85px);
    padding: 50px 25px;
  }
  .login-theme {
    top: 15px;
    right: 20px;
  }
  .avatar-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .avatar-option > span {
    height: 60px;
    font-size: 28px;
  }
  .form-row {
    display: block;
  }
  .markdown-preview {
    max-height: 400px;
  }
  .starter-toolbar label {
    width: 210px;
  }
  .lesson-topbar {
    height: 58px;
    padding: 0 12px;
    gap: 12px;
  }
  .lesson-topbar .status-label {
    display: none;
  }
  .lesson-topbar .button {
    padding: 5px 8px;
    font-size: 10px;
  }
  .lesson-title strong {
    font-size: 11px;
  }
  .lesson-title > span {
    font-size: 9px;
  }
  .instructions {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }
  .split-layout {
    position: relative;
  }
  .workspace {
    position: absolute;
    inset: 0;
  }
  .instructions {
    position: absolute;
    inset: 0;
    z-index: 3;
  }
  .resize-handle {
    display: none;
  }
  .lesson-shell:not(.instructions-collapsed) .workspace {
    visibility: hidden;
  }
  .lesson-shell:not(.instructions-collapsed) .instructions-header button {
    font-size: 0;
    width: auto;
    padding: 5px 10px;
    background: var(--lavender);
  }
  .lesson-shell:not(.instructions-collapsed) .instructions-header button:after {
    content: "Open workspace →";
    font-size: 11px;
    color: var(--primary);
  }
  .workspace-toolbar {
    height: auto;
    min-height: 44px;
    flex-wrap: wrap;
    padding: 0 8px;
    gap: 0;
  }
  .workspace-tab {
    font-size: 10px;
    min-height: 40px;
  }
  .workspace-actions .icon-button {
    width: 25px;
  }
  .workspace-tabs {
    gap: 3px;
    flex: 1 1 100%;
    justify-content: space-between;
    min-height: 40px;
  }
  .workspace-actions {
    margin-left: auto;
    min-height: 34px;
    align-items: center;
  }
  .fullscreen-workspace .workspace {
    visibility: visible !important;
  }
  .lesson-shell:not(.instructions-collapsed).fullscreen-workspace .workspace {
    visibility: visible;
  }
  .error-page {
    margin: 25px auto;
  }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-spinner {
    animation: none;
  }
  * {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

.mobile-signout {
  display: none;
}
@media (max-width: 680px) {
  .mobile-signout {
    display: flex;
    align-items: center;
  }
  .mobile-signout .icon-button {
    width: 24px;
  }
}

/* Public gallery and publishing */
.offscreen {
  position: fixed;
  left: -9999px;
  top: 0;
  opacity: 0;
}
.public-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
.public-header {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
  padding: 0 42px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.public-header .brand {
  font-size: 18px;
}
.public-nav {
  display: flex;
  gap: 6px;
}
.public-nav .nav-item {
  margin: 0;
  padding: 8px 12px;
}
.public-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.public-shell .page-content {
  width: 100%;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.gallery-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 13px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: border-color 0.15s;
}
.gallery-card:hover,
.gallery-card:focus-within {
  border-color: var(--primary);
}
.gallery-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
/* Render the site at desktop width, then scale it into the card. Scripts never run here. */
.gallery-thumb iframe {
  position: absolute;
  inset: 0 auto auto 0;
  width: 400%;
  height: 400%;
  border: 0;
  transform: scale(0.25);
  transform-origin: 0 0;
  pointer-events: none;
  background: #fff;
}
.gallery-card .card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.gallery-card h3 {
  font-size: 16px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.gallery-card h3 a:hover {
  color: var(--primary);
}
.gallery-card h3 a::after {
  content: "";
  position: absolute;
  inset: 0;
}
.gallery-description {
  font-size: 12px;
  margin-bottom: 14px;
  overflow-wrap: anywhere;
}
.gallery-author {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
  font-size: 12px;
  color: var(--muted);
}
.gallery-author strong {
  color: var(--text);
  font-weight: 600;
}
.gallery-author .avatar {
  width: 30px;
  height: 30px;
  font-size: 17px;
  border-radius: 9px;
}
.gallery-viewer {
  height: 100dvh;
  overflow: hidden;
}
.gallery-site {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.gallery-site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 42px;
  border-bottom: 1px solid var(--line);
}
.gallery-site-copy {
  min-width: 0;
}
.gallery-site-header h1 {
  font-size: 24px;
  margin-bottom: 6px;
  overflow-wrap: anywhere;
}
.gallery-site-header .gallery-author {
  margin-top: 0;
}
.gallery-site-header p {
  font-size: 12px;
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}
.gallery-site-header .card-meta {
  margin-bottom: 6px;
}
.gallery-site-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}
.gallery-frame {
  flex: 1;
  min-height: 0;
  padding: 18px 42px 28px;
  background: var(--surface2);
}
.gallery-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.publish-button {
  flex-shrink: 0;
}
#publish-dialog {
  width: min(480px, calc(100vw - 32px));
}
#publish-dialog textarea {
  resize: vertical;
}
.publish-live {
  background: var(--mint);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  margin: 8px 0 22px;
}
.publish-live > strong {
  display: block;
  font-size: 14px;
  margin-bottom: 12px;
}
.publish-live label {
  margin-bottom: 10px;
}
.copy-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 7px;
}
.copy-row input:not([type="checkbox"]):not([type="radio"]) {
  margin: 0;
  min-width: 0;
  font-size: 12px;
}
.publish-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.publish-links .quiet {
  padding: 0;
}
.publish-hint {
  font-size: 11px;
  margin: 10px 0 0;
}
.safety-note {
  display: flex;
  gap: 10px;
  background: var(--peach);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 18px;
}
.safety-note > span {
  font-size: 18px;
  line-height: 1.4;
}
.safety-note p {
  font-size: 11px;
  margin: 0;
  color: var(--text);
}
.form-error {
  font-size: 12px;
  color: #bd5c58;
  margin-bottom: 14px;
}
@media (max-width: 900px) {
  .gallery-site-header {
    flex-direction: column;
    align-items: stretch;
    padding: 16px 20px;
  }
  .gallery-site-actions .button {
    flex: 1;
  }
  .gallery-frame {
    padding: 12px 12px 16px;
  }
}
@media (max-width: 680px) {
  .public-header {
    min-height: 56px;
    padding: 0 16px;
    gap: 10px;
  }
  .public-header .brand {
    font-size: 15px;
  }
  .public-nav {
    display: none;
  }
  .public-shell .page-content {
    padding: 25px 16px;
  }
  .gallery-viewer {
    height: auto;
    overflow: visible;
  }
  .gallery-frame {
    height: 75dvh;
    flex: none;
  }
  .gallery-site-header h1 {
    font-size: 20px;
  }
  .lesson-topbar .publish-button {
    padding: 6px 9px;
  }
}
