:root {
  --bg: #f3f6f4;
  --bg-deep: #e7efe9;
  --surface: #ffffff;
  --surface-2: #f8fbf9;
  --ink: #15231c;
  --muted: #3d4f46;
  --line: #d5e0d9;
  --line-strong: #b8c9bf;
  --accent: #0c6b52;
  --accent-soft: #d7f0e6;
  --accent-ink: #084536;
  --warn: #9a6412;
  --danger: #b42318;
  --ok: #1a7a4a;
  --focus: #0c6b52;
  --shadow: 0 1px 0 rgba(21, 35, 28, 0.04), 0 12px 32px rgba(21, 35, 28, 0.06);
  --sans: "Figtree", "Segoe UI", sans-serif;
  --serif: "Literata", Georgia, serif;
  --mono: "IBM Plex Mono", Consolas, monospace;
  --radius: 14px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  color: var(--ink);
  font-family: var(--sans);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

:focus { outline: none; }
:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 70%, #fff);
  outline-offset: 2px;
}
.btn:focus-visible,
.nav-toggle:focus-visible,
.nav-search:focus-visible,
nav button:focus-visible,
.link:focus-visible,
.lab-tab:focus-visible,
.next-card:focus-visible,
.search-hit:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--focus) 75%, #fff);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 20;
  background: var(--accent);
  color: #fff;
  font: 700 0.88rem var(--sans);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
  text-decoration: none;
}
.skip-link:focus {
  top: 0.75rem;
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 50% at 10% -10%, rgba(12, 107, 82, 0.14), transparent 55%),
    radial-gradient(ellipse 55% 45% at 95% 5%, rgba(26, 95, 122, 0.1), transparent 50%),
    linear-gradient(180deg, #f8fbf9 0%, var(--bg) 42%, var(--bg-deep) 100%);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.grid-bg.has-theme-image {
  background-color: var(--bg-deep);
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  opacity: 1;
}
.grid-bg.has-theme-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 55%, transparent) 0%, var(--bg) 72%, var(--bg-deep) 100%);
  pointer-events: none;
}
body.theme-dark .grid-bg.has-theme-image::after {
  background: linear-gradient(180deg, color-mix(in srgb, var(--bg) 40%, transparent) 0%, var(--bg) 78%, var(--bg-deep) 100%);
}

.theme-picker {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}
.theme-swatch {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-align: left;
  padding: 0.55rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  cursor: pointer;
  color: inherit;
  font: inherit;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.theme-swatch:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-2px);
}
.theme-swatch.is-selected {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--accent-soft);
}
.theme-swatch-preview {
  display: block;
  height: 72px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  border: 1px solid var(--line);
}
.theme-swatch-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0 0.15rem 0.15rem;
}
.theme-swatch-meta strong {
  font-size: 0.88rem;
  line-height: 1.25;
}
.theme-swatch-meta small {
  color: var(--muted);
  font-size: 0.75rem;
}

.nav, main, .modal { position: relative; z-index: 1; }

.nav {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 0.7rem clamp(1rem, 3vw, 1.75rem);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 4;
}

.logo {
  background: none;
  border: 0;
  color: var(--ink);
  font: 700 1.15rem/1 var(--serif);
  letter-spacing: -0.02em;
  cursor: pointer;
  padding: 0.2rem 0;
  flex-shrink: 0;
}
.logo span {
  color: var(--accent);
  font-weight: 700;
}

nav.nav-menus {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.2rem;
  flex: 1;
  align-items: center;
  min-width: 0;
  justify-content: center;
}
.nav-group {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0;
  border: 0;
}
.nav-group-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: none;
  border: 0;
  color: var(--muted);
  font: 700 0.88rem var(--sans);
  cursor: pointer;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
  white-space: nowrap;
}
.nav-group-trigger:hover,
.nav-group.is-open > .nav-group-trigger,
.nav-group.nav-group-active > .nav-group-trigger {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.nav-chevron {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
  transition: transform 0.2s var(--ease);
}
.nav-group.is-open .nav-chevron {
  transform: rotate(225deg) translateY(-1px);
}
.nav-panel {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 50%;
  transform: translateX(-50%);
  min-width: 11.5rem;
  padding: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 40px rgba(21, 35, 28, 0.14);
  z-index: 30;
  flex-direction: column;
  gap: 0.1rem;
}
.nav-group.is-open > .nav-panel {
  display: flex;
}
.nav-panel button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--ink);
  font: 600 0.9rem var(--sans);
  cursor: pointer;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  text-decoration: none;
  transition: color 0.15s var(--ease), background 0.15s var(--ease);
  position: relative;
}
.nav-panel button:hover,
.nav-panel button.nav-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.nav-group-direct .nav-group-trigger.nav-direct.nav-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.nav-badge {
  position: absolute;
  top: 6px;
  right: 8px;
  min-width: 1.05rem;
  height: 1.05rem;
  padding: 0 0.28rem;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font: 700 0.62rem/1.05rem var(--mono);
  text-align: center;
  box-shadow: 0 0 0 2px var(--surface);
}
nav a, .link {
  background: none;
  border: 0;
  color: var(--muted);
  font: 600 0.86rem var(--sans);
  cursor: pointer;
  padding: 0.4rem 0.65rem;
  text-decoration: none;
  border-radius: 999px;
  transition: color 0.2s var(--ease), background 0.2s var(--ease);
  position: relative;
}
nav a:hover, .link:hover {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
a.btn { display: inline-block; text-decoration: none; margin-left: 0.4rem; }

.nav-user { display: flex; align-items: center; gap: 0.55rem; flex-shrink: 0; }
.chip {
  font: 600 0.72rem var(--mono);
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--line));
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}
.chip-profile {
  cursor: pointer;
}
.chip-profile:hover,
.chip-profile:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  font: 700 0.88rem var(--sans);
  letter-spacing: 0.01em;
  padding: 0.7rem 1.15rem;
  cursor: pointer;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
  box-shadow: 0 8px 20px rgba(12, 107, 82, 0.22);
}
.btn:hover { background: var(--accent-ink); transform: translateY(-1px); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn.secondary {
  background: transparent;
  color: var(--accent-ink);
  border: 1px solid var(--line-strong);
  box-shadow: none;
}
.btn.secondary:hover { background: var(--accent-soft); }

main {
  width: min(1080px, calc(100% - 2rem));
  margin: 0 auto 4rem;
  padding-top: 1.5rem;
}
.hidden { display: none !important; }

.kicker {
  font: 600 0.78rem var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
}

.hero-brand {
  font: 700 clamp(2.6rem, 7vw, 4.4rem)/0.95 var(--serif);
  letter-spacing: -0.03em;
  margin: 0 0 0.85rem;
  color: var(--ink);
  animation: rise 0.7s var(--ease) both;
}
.hero-brand span { color: var(--accent); }

h1 {
  font: 600 clamp(1.35rem, 3vw, 1.85rem)/1.25 var(--serif);
  margin: 0 0 0.75rem;
  color: var(--ink);
  max-width: 18ch;
  animation: rise 0.75s var(--ease) 0.06s both;
}
h1 em {
  color: var(--accent);
  font-style: italic;
  font-weight: 600;
}

.lede, .muted, .disclaimer {
  color: var(--muted);
  line-height: 1.65;
  max-width: 52ch;
}
.lede {
  font-size: 1.05rem;
  margin: 0 0 1.25rem;
  animation: rise 0.75s var(--ease) 0.12s both;
}
.hero-credit {
  margin: -0.55rem 0 1.15rem;
  font: 600 0.95rem / 1.45 var(--serif);
  color: var(--ink);
  letter-spacing: -0.01em;
  animation: rise 0.75s var(--ease) 0.14s both;
}
.landing-footer {
  margin-top: 2.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0.55rem;
}
.landing-credit {
  margin: 0;
  animation: none;
}
.disclaimer {
  font-size: 0.82rem;
  margin: 0;
  max-width: 62ch;
  border-top: 0;
  padding-top: 0;
}

.about-page {
  max-width: 52rem;
}
.about-lede {
  max-width: 44rem;
}
.about-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}
.about-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem 1.3rem;
  box-shadow: var(--shadow);
}
.about-card-wide {
  grid-column: 1 / -1;
}
.about-card h3 {
  margin: 0 0 0.55rem;
  font: 700 1.15rem / 1.25 var(--serif);
  letter-spacing: -0.02em;
}
.about-card > p {
  margin: 0 0 0.75rem;
  color: var(--muted);
  line-height: 1.55;
}
.about-list {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.45rem;
  color: var(--ink);
  line-height: 1.45;
}
.about-list li::marker {
  color: var(--accent);
}
.about-dev {
  background: linear-gradient(180deg, var(--surface), var(--accent-soft));
  border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}
.about-dev-name {
  margin: 0 0 0.2rem !important;
  font: 700 1.35rem / 1.2 var(--serif);
  color: var(--ink) !important;
  letter-spacing: -0.02em;
}
.about-note {
  margin: 0 0 1rem;
  max-width: 46rem;
}

@media (max-width: 800px) {
  .about-grid { grid-template-columns: 1fr; }
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0 0 1.75rem;
  animation: rise 0.75s var(--ease) 0.18s both;
}

.how-strip {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0 0 2rem;
  padding: 0;
  animation: rise 0.8s var(--ease) 0.22s both;
}
.how-strip li {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.55rem 0.85rem;
  font: 600 0.84rem var(--sans);
  color: var(--ink);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.how-strip li:not(:last-child)::after {
  content: "";
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  margin-left: 0.55rem;
  border-right: 2px solid var(--accent);
  border-top: 2px solid var(--accent);
  transform: rotate(45deg);
  opacity: 0.55;
  vertical-align: middle;
}

.me-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0 0 2rem;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0.95rem 1.05rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat b {
  display: block;
  font: 700 1.25rem var(--serif);
  color: var(--ink);
}
.stat span {
  color: var(--muted);
  font-size: 0.8rem;
}

.path-heading {
  font: 700 0.8rem var(--sans);
  margin: 0 0 0.9rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.path {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.65rem;
}
.courses-hub {
  margin-top: 1.75rem;
}
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 0.35rem 0 0.5rem;
}
.course-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-height: 100%;
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  animation: rise 0.45s var(--ease) both;
}
.course-card:hover:not(.is-locked) {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 14px 36px rgba(21, 35, 28, 0.08);
}
.course-card.is-locked { opacity: 0.7; }
.course-card.is-done {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  background: linear-gradient(180deg, #fff, #f3faf6);
}
.course-card-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.course-num {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: 700 0.85rem var(--mono);
}
.course-card.is-locked .course-num {
  background: var(--bg-deep);
  color: var(--muted);
}
.course-kicker {
  margin: 0.15rem 0 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
}
.course-card h3 {
  font-family: var(--serif);
  margin: 0;
  letter-spacing: -0.02em;
  font-size: 1.2rem;
  line-height: 1.25;
}
.course-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  flex: 1;
}
.path-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1rem 1.15rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.path-card:hover:not(.locked) {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 14px 36px rgba(21, 35, 28, 0.08);
}
.path-card.locked { opacity: 0.62; }
.path-card.done {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  background: linear-gradient(180deg, #fff, #f3faf6);
}
.path-num {
  width: 2.6rem;
  height: 2.6rem;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font: 700 0.85rem var(--mono);
}
.path-card.locked .path-num {
  background: var(--bg-deep);
  color: var(--muted);
}
.path-card h3 {
  margin: 0 0 0.2rem;
  font: 700 1.05rem/1.25 var(--serif);
}
.path-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
}
.meta {
  font: 600 0.72rem var(--mono);
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.progress-rail {
  height: 4px;
  background: var(--bg-deep);
  border-radius: 999px;
  margin-top: 0.65rem;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 0.4s var(--ease);
}

.split {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.1rem;
  min-height: 70vh;
}
@media (max-width: 840px) {
  .split { grid-template-columns: 1fr; }
  .nav { flex-wrap: wrap; }
}

.learn-shell { margin-top: 0.25rem; }
.learn-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.learn-top h2 {
  font-family: var(--serif);
  margin: 0.15rem 0 0.35rem;
  letter-spacing: -0.02em;
}
.learn-lede { max-width: 46rem; margin: 0; }
.learn-split {
  grid-template-columns: minmax(280px, 340px) 1fr;
  gap: 1.15rem;
  align-items: start;
}
@media (max-width: 920px) {
  .learn-split { grid-template-columns: 1fr; }
}

.lesson-nav {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.85rem;
  max-height: min(78vh, 920px);
  overflow: auto;
  box-shadow: var(--shadow);
  position: sticky;
  top: 4.5rem;
}
.learn-nav-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.15rem 0.35rem 0.75rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.65rem;
}
.learn-nav-head strong {
  font: 700 0.95rem var(--serif);
}
.learn-modules { display: flex; flex-direction: column; gap: 0.55rem; }
.learn-mod {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  overflow: hidden;
}
.learn-mod.is-open {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: #fff;
}
.learn-mod.is-locked {
  background: #f4f6f5;
  border-style: dashed;
  border-color: #9aa89f;
}
.learn-mod.is-done {
  border-color: #9fd4b8;
  background: #f3faf6;
}
.learn-mod-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0.7rem 0.75rem;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
}
.learn-mod-index {
  font: 700 0.72rem var(--mono);
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  min-width: 2rem;
  text-align: center;
}
.learn-mod.is-locked .learn-mod-index {
  background: #e4e9e6;
  color: #3d4f46;
}
.learn-mod-title {
  display: block;
  font: 700 0.9rem var(--sans);
  color: var(--ink);
  line-height: 1.25;
}
.learn-mod-meta {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.75rem;
}
.learn-mod-status {
  font: 700 0.68rem var(--mono);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.3rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}
.learn-mod-status.open {
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.learn-mod-status.done {
  background: #d8f3e4;
  color: #146c43;
}
.learn-mod-status.locked {
  background: #3d4f46;
  color: #fff;
}
.learn-lock-note {
  margin: 0 0.75rem 0.65rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: #fff8e8;
  border: 1px solid #ecd9a8;
  color: #7a5a12;
  font-size: 0.8rem;
  line-height: 1.45;
}
.learn-mod-lessons {
  padding: 0 0.55rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.learn-mod-progress {
  height: 5px;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
  margin: 0 0.2rem 0.45rem;
}
.learn-mod-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #2a9d75);
}
.learn-lesson {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.55rem;
  align-items: center;
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  color: var(--ink);
  font: inherit;
  transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}
.learn-lesson:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.learn-lesson.active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 3px 0 0 var(--accent);
}
.learn-lesson.passed {
  border-color: #9fd4b8;
}
.learn-lesson:disabled {
  cursor: not-allowed;
  background: #eef1ef;
  border-color: #c5d0c9;
  color: #2f3d36;
  opacity: 1;
}
.learn-lesson:disabled strong,
.learn-lesson:disabled .meta {
  color: #2f3d36;
}
.learn-lesson-mark {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font: 700 0.72rem var(--mono);
  background: var(--bg-deep);
  color: var(--accent-ink);
  flex-shrink: 0;
}
.learn-lesson.passed .learn-lesson-mark {
  background: #146c43;
  color: #fff;
}
.learn-lesson:disabled .learn-lesson-mark {
  background: #d5ddd8;
  color: #44554c;
}
.learn-lesson-body strong {
  display: block;
  font-size: 0.86rem;
  line-height: 1.3;
}
.learn-lesson-body .meta {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.learn-lesson-lock { font-size: 0.85rem; opacity: 0.85; }

.lesson-pane {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.35rem 1.5rem 1.6rem;
  box-shadow: var(--shadow);
  min-height: 420px;
}
.learn-empty {
  padding: 1.5rem 0.5rem;
  max-width: 34rem;
}
.learn-empty h3 {
  font-family: var(--serif);
  margin: 0.35rem 0 0.5rem;
}
.lesson-hero {
  padding-bottom: 1rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.lesson-hero h2 {
  font-family: var(--serif);
  margin: 0.55rem 0 0;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.lesson-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.chip-soft {
  display: inline-block;
  font: 600 0.72rem var(--mono);
  color: var(--accent-ink);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}
.chip-lock {
  display: inline-block;
  font: 700 0.72rem var(--mono);
  color: #fff;
  background: #3d4f46;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}
.learn-lock-banner {
  margin: 0.85rem 0 0;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #fff3d6;
  border: 1px solid #e6c97a;
  color: #7a5a12;
  font-weight: 600;
}
.lesson-body-wrap { line-height: 1.7; }
.lesson-body-wrap h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin: 1.5rem 0 0.45rem;
  color: var(--accent-ink);
}

/* legacy lesson-nav buttons kept for safety */
.lesson-nav > button {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  color: var(--ink);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  font: 500 0.88rem var(--sans);
  border-radius: 10px;
}
.lesson-nav .trk {
  color: var(--accent);
  font: 700 0.7rem var(--sans);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0.75rem 0.45rem 0.3rem;
}

.lesson-pane h2 {
  font-family: var(--serif);
  margin-top: 0;
  letter-spacing: -0.02em;
}
.lesson-pane h3 {
  font-family: var(--serif);
  font-size: 1.15rem;
  margin: 1.5rem 0 0.45rem;
  color: var(--accent-ink);
}
.lesson-pane p, .lesson-pane li { line-height: 1.7; }
.lesson-pane pre, .sql-out, textarea, .nb-code {
  background: #132019;
  color: #e7f2ec;
  border: 1px solid #24362c;
  padding: 0.9rem 1rem;
  overflow: auto;
  font: 0.84rem/1.55 var(--mono);
  border-radius: 12px;
}
.quiz {
  margin-top: 1.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
}
.q { margin: 1.1rem 0; }
.q label {
  display: block;
  margin: 0.35rem 0;
  cursor: pointer;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  transition: background 0.15s var(--ease);
}
.q label:hover { background: var(--surface-2); }
.explain { color: var(--muted); font-size: 0.88rem; }
.ok { color: var(--ok); }
.bad { color: var(--danger); }
textarea {
  width: 100%;
  min-height: 150px;
  margin: 0.8rem 0;
}
.sql-out { min-height: 88px; }
.challenges { padding-left: 1.2rem; color: var(--muted); }
.lab-links { display: flex; gap: 0.5rem; flex-wrap: wrap; margin: 1rem 0; }

/* Catalog hubs — Lectures / Training / Challenges / Games */
.hub-header {
  margin-bottom: 0.35rem;
}
.hub-header h2 {
  margin: 0.15rem 0 0.4rem;
  font: 700 clamp(1.6rem, 2.4vw, 2.05rem) / 1.15 var(--serif);
  letter-spacing: -0.03em;
}
.hub-header .lede {
  max-width: 46rem;
  margin: 0 0 1rem;
}
.hub-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 0.55rem;
  margin: 0 0 1rem;
  max-width: 42rem;
}
.hub-summary-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  box-shadow: var(--shadow);
}
.hub-summary-item b {
  display: block;
  font: 700 1.25rem / 1.1 var(--serif);
  color: var(--ink);
}
.hub-summary-item span {
  display: block;
  margin-top: 0.15rem;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.hub-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin: 0 0 0.75rem;
}
.hub-search {
  flex: 1 1 220px;
  min-width: 180px;
  max-width: 320px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.85rem;
  box-shadow: var(--shadow);
}
.hub-search:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-color: var(--accent);
}
.hub-chips,
.hub-topics {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}
.hub-topics {
  margin: 0 0 1rem;
  padding-top: 0.15rem;
}
.hub-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  font: 650 0.82rem var(--sans);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: background 0.18s var(--ease), color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.hub-chip span {
  display: inline-flex;
  min-width: 1.2rem;
  justify-content: center;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--bg-deep);
  color: var(--ink);
  font: 700 0.7rem var(--mono);
}
.hub-chip:hover {
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.hub-chip.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
}
.hub-chip.is-active span {
  background: var(--accent);
  color: #fff;
}
.hub-chip-soft {
  background: var(--surface-2);
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
}
.hub-card-grid {
  margin-top: 0.35rem;
}
.hub-card {
  min-height: 100%;
}
.hub-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.35rem;
}
.hub-manage {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.hub-manage > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--ink);
}
.games-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 0.25rem;
}

/* Training Courses + Challenge Packs */
.tut-course-grid,
.ch-pack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1.4rem 0 2rem;
}
.tut-course-card,
.ch-pack-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1.25rem;
  box-shadow: var(--shadow);
  border-top: 3px solid var(--tut-accent, var(--ch-accent, var(--accent)));
  animation: rise 0.45s var(--ease) both;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.tut-course-card h3,
.ch-pack-card h3 {
  font-family: var(--serif);
  margin: 0.15rem 0;
  letter-spacing: -0.02em;
  font-size: 1.25rem;
}
.tut-course-card p,
.ch-pack-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.tut-course-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.tut-level,
.ch-badge {
  display: inline-block;
  font: 600 0.72rem var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
}
.ch-badge {
  color: #fff;
  background: var(--accent);
}
.tut-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 0.6rem 0 0.8rem;
}
.tut-stats span {
  background: var(--surface-2);
  border: 1px solid var(--line);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font: 600 0.8rem var(--sans);
  color: var(--muted);
}
.tut-progress-rail {
  height: 6px;
  background: var(--bg-deep);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.35rem 0 0.5rem;
}
.tut-progress-rail .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #2a9d75);
  border-radius: 999px;
  transition: width 0.35s var(--ease);
}
.tut-chapter {
  margin: 1.4rem 0;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.tut-chapter header h3 {
  font-family: var(--serif);
  margin: 0 0 0.25rem;
}
.tut-chapter header p {
  margin: 0 0 0.85rem;
  color: var(--muted);
}
.tut-ex-list,
.ch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.tut-ex-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  padding: 0.75rem 0.85rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.tut-ex-list li.passed {
  border-color: #9fd4b8;
  background: #f0faf4;
}
.tut-ex-list li.locked {
  opacity: 0.55;
}
.tut-ex-list li .meta {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.tutorial-workspace {
  margin-top: 0.5rem;
}
.tut-split {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(300px, 1.1fr);
  gap: 1rem;
  margin-top: 0.75rem;
  min-height: 70vh;
}
.tut-story {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  overflow: auto;
}
.tut-story h2 {
  font-family: var(--serif);
  margin: 0.35rem 0 0.75rem;
  letter-spacing: -0.02em;
}
.tut-story h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
  margin: 1.2rem 0 0.4rem;
  color: var(--accent-ink);
}
.tut-body {
  line-height: 1.7;
}
.tut-body code {
  font-family: var(--mono);
  font-size: 0.86em;
  background: var(--accent-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.tut-editor {
  background: #132019;
  color: #e7f2ec;
  border-radius: var(--radius);
  border: 1px solid #24362c;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  box-shadow: var(--shadow);
}
.tut-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}
.tut-toolbar .meta { color: #9bb5a8; }
.tut-code {
  flex: 1;
  min-height: 260px;
  width: 100%;
  margin: 0;
  background: #0d1612;
  color: #e7f2ec;
  border: 1px solid #24362c;
  border-radius: 10px;
  font: 0.88rem/1.55 var(--mono);
  padding: 0.85rem 1rem;
  resize: vertical;
}
.tut-out {
  margin: 0.35rem 0 0;
  min-height: 88px;
  background: #0a120e;
  color: #cfe4d8;
  border: 1px solid #24362c;
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  font: 0.82rem/1.5 var(--mono);
  overflow: auto;
}
.tut-editor .btn.secondary {
  background: #24362c;
  color: #e7f2ec;
  border-color: #355244;
}
@media (max-width: 900px) {
  .tut-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

.lecture-workspace { margin-top: 0.5rem; }
.lec-split {
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(280px, 0.95fr);
  gap: 1rem;
  margin-top: 0.75rem;
  min-height: 70vh;
}
.lec-reading {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
  overflow: auto;
}
.lec-reading h2 {
  font-family: var(--serif);
  margin: 0.35rem 0 0.85rem;
  letter-spacing: -0.02em;
}
.lec-body {
  line-height: 1.7;
}
.lec-body h3 {
  font-family: var(--serif);
  font-size: 1.08rem;
  margin: 1.25rem 0 0.4rem;
  color: var(--accent-ink);
}
.lec-body pre, .lec-body code {
  font-family: var(--mono);
}
.lec-body pre {
  background: #132019;
  color: #e7f2ec;
  border: 1px solid #24362c;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  overflow: auto;
  font-size: 0.84rem;
  line-height: 1.55;
}
.lec-body code {
  font-size: 0.86em;
  background: var(--accent-soft);
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
}
.lec-body pre code {
  background: transparent;
  padding: 0;
  color: inherit;
}
.lec-sim {
  background: #132019;
  color: #e7f2ec;
  border-radius: var(--radius);
  border: 1px solid #24362c;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  box-shadow: var(--shadow);
}
.lec-sim .kicker { color: #9bb5a8; }
.lec-sim h3 {
  font-family: var(--serif);
  margin: 0.2rem 0 0.45rem;
  color: #e7f2ec;
}
.lec-sim .muted { color: #9bb5a8; }
.lec-sim .tut-code {
  flex: 1;
  min-height: 220px;
}
.lec-card {
  border-top-color: #0f4c81;
}
@media (max-width: 900px) {
  .lec-split {
    grid-template-columns: 1fr;
    min-height: 0;
  }
}

.lab-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1.1rem 0 1.3rem;
}
.lab-tab {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  padding: 0.55rem 0.95rem;
  cursor: pointer;
  font: 600 0.88rem var(--sans);
  border-radius: 999px;
  transition: all 0.2s var(--ease);
}
.lab-tab.on {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}
.lab-panel { margin-top: 0.4rem; }
.lab-panel h2, .lab-panel h3 {
  font-family: var(--serif);
  letter-spacing: -0.02em;
}

.games-hub {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-top: 1.1rem;
}
.games-filter { margin: 1rem 0 0.2rem; }
.game-card {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform 0.25s var(--ease);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.game-card > .icon,
.game-card > .game-tags,
.game-card > h3,
.game-card > p,
.game-card > .btn { margin-left: 1.15rem; margin-right: 1.15rem; }
.game-card > .btn { margin-bottom: 1.1rem; align-self: flex-start; }
.game-card:hover { transform: translateY(-3px); }
.game-card.game-story { border-top: 3px solid #0f4c81; }
.game-card-art {
  height: 120px;
  background: linear-gradient(135deg, #d7e8f5, #eef6f1);
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.game-card-art.has-cover {
  background: #1e293b;
  padding: 0;
}
.game-card-art.has-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.game-card .icon {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent-soft);
  font-size: 1.15rem;
  margin-top: -1.1rem;
  margin-bottom: 0.45rem;
  position: relative;
  z-index: 1;
  border: 2px solid var(--surface);
}
.game-tags { display: flex; gap: 0.4rem; align-items: center; margin-bottom: 0.35rem; }
.game-card h3 {
  margin: 0 0 0.35rem;
  font: 700 1.08rem var(--serif);
}
.game-card p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0 0.95rem;
  flex: 1;
}
.game-play {
  margin-top: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.35rem 1.4rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.game-choices {
  display: grid;
  gap: 0.55rem;
  margin-top: 1rem;
}
.game-choice {
  text-align: left;
  background: var(--surface-2);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.8rem 0.95rem;
  cursor: pointer;
  font: 500 0.92rem var(--sans);
  line-height: 1.4;
  border-radius: 12px;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.game-choice:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.game-play .ok { color: var(--ok); font-weight: 700; }
.game-q { margin: 0.85rem 0 0; }

.story-frame {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(260px, 1.1fr);
  gap: 1rem;
  margin-top: 0.75rem;
  align-items: stretch;
}
.story-copy h3 { font-family: var(--serif); margin: 0.2rem 0 0.55rem; }
.story-dialogue {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1rem;
  font-style: italic;
  line-height: 1.55;
}
.comic-panel {
  position: relative;
  min-height: 220px;
  border: 3px solid #1a2e24;
  border-radius: 6px;
  overflow: hidden;
  background: #f4efe4;
  box-shadow: 4px 4px 0 #1a2e24;
}
.comic-sky {
  position: absolute; inset: 0 0 35% 0;
  background: linear-gradient(180deg, #9ad0ff, #e8f4ff);
  animation: comicDrift 8s ease-in-out infinite alternate;
}
.comic-prop {
  position: absolute; left: 8%; right: 8%; bottom: 12%;
  height: 42%;
  border-radius: 10px 10px 4px 4px;
  background: #2f6b52;
  box-shadow: inset 0 8px 0 rgba(255,255,255,0.12);
}
.comic-char {
  position: absolute;
  bottom: 18%;
  width: 42px;
  height: 70px;
  border-radius: 18px 18px 10px 10px;
  animation: comicBounce 1.8s ease-in-out infinite;
}
.comic-char-a { left: 18%; background: #0c6b52; animation-delay: 0s; }
.comic-char-b { right: 22%; background: #0f4c81; animation-delay: 0.25s; }
.comic-char::before {
  content: "";
  position: absolute;
  top: -16px; left: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #f2d2b6;
  border: 2px solid #1a2e24;
}
.comic-bubble {
  position: absolute;
  top: 12%; right: 10%;
  width: 54px; height: 36px;
  background: #fff;
  border: 2px solid #1a2e24;
  border-radius: 16px;
  animation: comicPop 2.4s ease-in-out infinite;
}
.comic-bubble::after {
  content: "";
  position: absolute;
  left: 12px; bottom: -8px;
  border: 6px solid transparent;
  border-top-color: #1a2e24;
}

/* Art theme accents */
.art-gate .comic-prop { background: linear-gradient(90deg, #6b8f71, #3d5c45); }
.art-board .comic-prop { background: #243447; }
.art-board .comic-sky { background: linear-gradient(180deg, #ffe08a, #fff6d6); }
.art-think .comic-sky { background: linear-gradient(180deg, #d5c7ff, #f3efff); }
.art-report .comic-prop,
.art-poster .comic-prop { background: #c45c26; }
.art-canteen .comic-sky { background: linear-gradient(180deg, #ffd0a8, #fff1e2); }
.art-clinic .comic-sky { background: linear-gradient(180deg, #b8e0d2, #eefaf5); }
.art-booth .comic-prop { background: #7a3e9d; }
.art-quiz { background: linear-gradient(135deg, #d7f0e6, #e7efe9) !important; }
.game-card-art.art-gate { background: linear-gradient(135deg, #9ad0ff, #d7f0e6); }
.game-card-art.art-poster { background: linear-gradient(135deg, #ffd0a8, #ffe08a); }
.game-card-art.art-canteen { background: linear-gradient(135deg, #ffc9a3, #f7e2c8); }
.game-card-art.art-clinic { background: linear-gradient(135deg, #b8e0d2, #d7e8f5); }
.game-card-art.art-booth { background: linear-gradient(135deg, #e2d0f5, #f8e7ff); }

@keyframes comicBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes comicPop {
  0%, 100% { transform: scale(1); opacity: 0.9; }
  50% { transform: scale(1.08); opacity: 1; }
}
@keyframes comicDrift {
  from { filter: saturate(1); }
  to { filter: saturate(1.15); }
}

.xp-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e8f5ef;
  color: #0c6b52;
}
.game-style-label { margin: 0 1.15rem 0.65rem; opacity: 0.75; }
.anti-banner {
  margin: 0.5rem 0 0.75rem;
  padding: 0.55rem 0.75rem;
  border-left: 3px solid #b45309;
  background: #fff7ed;
  color: #9a3412;
  font-size: 0.9rem;
  font-weight: 600;
}
.camp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.camp-diffs { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.camp-concentration {
  margin: 0.35rem 0 0.5rem;
  color: var(--ink, #1a1a1a);
  font-size: 0.95rem;
}
.admin-camp-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 12rem;
  flex: 1 1 12rem;
}
.camp-form { margin-bottom: 1.25rem; }
.camp-events { display: grid; gap: 0.85rem; }
.comp-games-pick {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.75rem 0;
}
.comp-games-pick legend { font-weight: 700; padding: 0 0.35rem; }
.comp-game-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.35rem 0.75rem;
  max-height: 220px;
  overflow: auto;
  margin-top: 0.5rem;
}
.game-card.comp-done { outline: 2px solid #0c6b52; }

.practice-banner,
.comp-roe {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  margin: 0.85rem 0 1.1rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent, #0c6b52) 8%, transparent), transparent);
}
.practice-banner {
  background: color-mix(in srgb, #b45309 12%, transparent);
  border-color: color-mix(in srgb, #b45309 35%, var(--line));
  font-weight: 600;
}
.comp-roe-done { opacity: 0.95; }
.comp-roe-list {
  margin: 0.5rem 0 0.85rem;
  padding-left: 1.2rem;
  display: grid;
  gap: 0.35rem;
}
.comp-section-title {
  margin: 1.35rem 0 0.35rem;
  font-size: 1.05rem;
}
.comp-host-tools {
  margin-top: 1.25rem;
  display: grid;
  gap: 0.75rem;
}
.comp-observer table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  margin: 0.5rem 0 1rem;
}
.comp-observer th,
.comp-observer td {
  border-bottom: 1px solid var(--line);
  padding: 0.35rem 0.45rem;
  text-align: left;
}
.comp-recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
  max-height: 220px;
  overflow: auto;
}
.comp-recent-list li {
  padding: 0.35rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
}

/* Distinct 2D comic / professional card skins per game style */
.game-card.style-terminal_noir { border-color: #1e293b; background: linear-gradient(180deg, #0f172a 0%, #1e293b 40%, #f8fafc 40%); color: #0f172a; }
.game-card.style-terminal_noir .game-card-art { background: repeating-linear-gradient(0deg, #022c22, #022c22 2px, #064e3b 2px, #064e3b 4px); }
.game-card.style-terminal_noir .icon { color: #4ade80; background: #022c22; }
.game-card.style-formula_dash { border-top: 3px solid #0369a1; }
.game-card.style-formula_dash .game-card-art { background: linear-gradient(135deg, #e0f2fe, #fef9c3); }
.game-card.style-infographic_casebook { border-top: 3px solid #c2410c; }
.game-card.style-infographic_casebook .game-card-art { background: linear-gradient(120deg, #ffedd5, #fecaca 50%, #e0e7ff); }
.game-card.style-cleanup_workshop { border-top: 3px solid #15803d; }
.game-card.style-cleanup_workshop .game-card-art { background: linear-gradient(135deg, #dcfce7, #fef3c7); }
.game-card.style-bayanihan_debug { border-top: 3px solid #be123c; }
.game-card.style-bayanihan_debug .game-card-art { background: linear-gradient(135deg, #ffe4e6, #fef9c3); }
.game-card.style-pipeline_blueprint { border-top: 3px solid #1d4ed8; background: #f8fafc; }
.game-card.style-pipeline_blueprint .game-card-art { background: repeating-linear-gradient(90deg, #dbeafe, #dbeafe 8px, #eff6ff 8px, #eff6ff 16px); }
.game-card.style-vector_arcade { border-top: 3px solid #7c3aed; }
.game-card.style-vector_arcade .game-card-art { background: radial-gradient(circle at 30% 40%, #c4b5fd, #ddd6fe 40%, #ede9fe); }
.game-card.style-etl_control_room { border-top: 3px solid #0f766e; }
.game-card.style-etl_control_room .game-card-art { background: linear-gradient(160deg, #134e4a, #5eead4 55%, #ccfbf1); }
.game-card.style-cloud_isometric { border-top: 3px solid #0284c7; }
.game-card.style-cloud_isometric .game-card-art { background: linear-gradient(145deg, #bae6fd, #ffffff 45%, #e0f2fe); }
.game-card.style-executive_dashboard { border-top: 3px solid #334155; }
.game-card.style-executive_dashboard .game-card-art { background: linear-gradient(90deg, #1e293b 0 35%, #f1f5f9 35%); }
.game-card.style-campus_mystery { border-top: 3px solid #475569; }
.game-card.style-campus_mystery .game-card-art { background: linear-gradient(135deg, #cbd5e1, #fef3c7); }
.game-card.style-poster_pop { border-top: 3px solid #ea580c; }
.game-card.style-poster_pop .game-card-art { background: linear-gradient(135deg, #fdba74, #fde68a 50%, #fbcfe8); }
.game-card.style-canteen_comic { border-top: 3px solid #b45309; }
.game-card.style-canteen_comic .game-card-art { background: linear-gradient(135deg, #fdba74, #fed7aa, #ffedd5); }
.game-card.style-clinic_storyboard { border-top: 3px solid #0d9488; }
.game-card.style-clinic_storyboard .game-card-art { background: linear-gradient(135deg, #99f6e4, #e0f2fe); }
.game-card.style-ethics_court { border-top: 3px solid #6d28d9; }
.game-card.style-ethics_court .game-card-art { background: linear-gradient(135deg, #ddd6fe, #fce7f3); }
.game-card.style-release_train { border-top: 3px solid #b91c1c; }
.game-card.style-release_train .game-card-art { background: linear-gradient(90deg, #fecaca, #fee2e2 40%, #e2e8f0); }
.game-card.style-language_newsroom { border-top: 3px solid #0369a1; }
.game-card.style-language_newsroom .game-card-art { background: linear-gradient(135deg, #bae6fd, #fef9c3); }
.game-card.style-forecast_weatherboard { border-top: 3px solid #2563eb; }
.game-card.style-forecast_weatherboard .game-card-art { background: linear-gradient(180deg, #7dd3fc, #e0f2fe 55%, #fef08a); }
.game-card.style-rag_library { border-top: 3px solid #92400e; }
.game-card.style-rag_library .game-card-art { background: linear-gradient(135deg, #fde68a, #fef3c7 40%, #d6d3d1); }
.game-card.style-neural_lab { border-top: 3px solid #4f46e5; }
.game-card.style-neural_lab .game-card-art { background: radial-gradient(circle at 70% 30%, #a5b4fc, #e0e7ff 45%, #c7d2fe); }

.comic-panel.style-terminal_noir .comic-sky { background: #022c22; }
.comic-panel.style-terminal_noir .comic-char-a { background: #4ade80; animation: comicBlink 1.2s steps(2) infinite; }
.comic-panel.style-formula_dash .comic-sky { background: linear-gradient(180deg, #bae6fd, #fef9c3); }
.comic-panel.style-formula_dash .comic-prop { clip-path: polygon(0 40%, 100% 20%, 100% 100%, 0 100%); }
.comic-panel.style-pipeline_blueprint .comic-sky { background: repeating-linear-gradient(90deg, #bfdbfe, #bfdbfe 1px, #eff6ff 1px, #eff6ff 12px); }
.comic-panel.style-vector_arcade .comic-char-a,
.comic-panel.style-vector_arcade .comic-char-b { border-radius: 0; animation: comicSlide 2s ease-in-out infinite alternate; }
.comic-panel.style-etl_control_room .comic-sky { background: #134e4a; }
.comic-panel.style-etl_control_room .comic-bubble { animation: comicPulse 1.4s ease-in-out infinite; }
.comic-panel.style-cloud_isometric .comic-prop { transform: skewX(-12deg); background: #38bdf8; }
.comic-panel.style-poster_pop .comic-sky { background: linear-gradient(135deg, #fb923c, #facc15); }
.comic-panel.style-poster_pop .comic-bubble { animation: comicSpinPop 2.8s ease-in-out infinite; }
.comic-panel.style-canteen_comic .comic-sky { background: linear-gradient(180deg, #fdba74, #fff7ed); }
.comic-panel.style-clinic_storyboard .comic-sky { background: linear-gradient(180deg, #99f6e4, #ecfeff); }
.comic-panel.style-ethics_court .comic-prop { background: #7c3aed; height: 28%; }
.comic-panel.style-release_train .comic-prop { width: 70%; left: 15%; animation: comicTrain 3s linear infinite; }
.comic-panel.style-language_newsroom .comic-sky { background: linear-gradient(180deg, #7dd3fc, #fef9c3); }
.comic-panel.style-forecast_weatherboard .comic-sky { background: linear-gradient(180deg, #38bdf8, #fef08a); }
.comic-panel.style-rag_library .comic-prop { background: repeating-linear-gradient(90deg, #92400e, #92400e 10px, #b45309 10px, #b45309 20px); }
.comic-panel.style-neural_lab .comic-sky { background: radial-gradient(circle at 50% 30%, #818cf8, #312e81); }
.comic-panel.style-neural_lab .comic-char-a { animation: comicGlow 1.6s ease-in-out infinite; }

.game-play-shell.style-terminal_noir {
  background: #0f172a;
  color: #4ade80;
  font-family: "IBM Plex Mono", monospace;
  padding: 1rem;
  border-radius: 8px;
}
.game-play-shell.style-vector_arcade { border: 3px solid #7c3aed; padding: 1rem; border-radius: 0; }
.game-play-shell.style-executive_dashboard { border-left: 4px solid #334155; padding-left: 1rem; }

@keyframes comicBlink { 50% { opacity: 0.55; } }
@keyframes comicSlide { from { transform: translateX(0); } to { transform: translateX(10px); } }
@keyframes comicPulse { 50% { transform: scale(1.12); } }
@keyframes comicSpinPop { 0%, 100% { transform: rotate(-2deg) scale(1); } 50% { transform: rotate(3deg) scale(1.1); } }
@keyframes comicTrain { from { transform: translateX(-20%); } to { transform: translateX(20%); } }
@keyframes comicGlow { 50% { box-shadow: 0 0 12px #a5b4fc; } }

.admin-card-wide { grid-column: 1 / -1; }
.admin-campaigns { display: grid; gap: 0.65rem; margin-top: 0.75rem; }
.admin-camp-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg, #fafafa);
}
.admin-camp-row strong { min-width: 9rem; }

.admin-shell { margin-top: 1rem; }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0.35rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  position: sticky;
  top: 0.5rem;
  z-index: 5;
  box-shadow: var(--shadow);
}
.admin-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: 650 0.88rem var(--sans);
  padding: 0.55rem 0.85rem;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.admin-tab:hover { color: var(--ink); background: var(--surface-2); }
.admin-tab.is-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}
.admin-tab-badge {
  display: inline-flex;
  min-width: 1.25rem;
  justify-content: center;
  padding: 0.1rem 0.35rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font: 700 0.68rem var(--mono);
}
.admin-panel { display: none; }
.admin-panel.is-active { display: block; animation: adminFade 0.22s var(--ease); }
@keyframes adminFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
.admin-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  margin-bottom: 1rem;
}
.admin-summary-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 0.95rem;
  box-shadow: var(--shadow);
}
.admin-summary-item b {
  display: block;
  font: 700 1.35rem var(--serif);
  line-height: 1.15;
}
.admin-summary-item span {
  color: var(--muted);
  font-size: 0.75rem;
}
.admin-grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.admin-stack { display: grid; gap: 1rem; }
.admin-card-title {
  margin: 0 0 0.35rem;
  font: 700 1.05rem var(--serif);
}
.admin-hint { margin: 0 0 0.75rem; font-size: 0.88rem; }
.admin-card-narrow { max-width: 34rem; }
.admin-subhead {
  margin: 1.1rem 0 0.55rem;
  font: 700 0.92rem var(--sans);
}
.admin-restore-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: flex-end;
  margin: 0.75rem 0 0.35rem;
}
.admin-file-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1 1 220px;
  font: 650 0.85rem var(--sans);
  color: var(--muted);
}
.admin-file-label input[type="file"] {
  font: inherit;
  color: var(--ink);
}
.admin-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  margin: 0.5rem 0 0.85rem;
}
.admin-search,
.admin-filter {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: var(--surface);
  color: var(--ink);
}
.admin-search { flex: 1 1 180px; min-width: 160px; }
.admin-filter { min-width: 140px; }
.admin-table-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-top: 1rem;
}
.admin-list { display: grid; gap: 0.55rem; }
.admin-list-scroll {
  max-height: 420px;
  overflow: auto;
  padding-right: 0.25rem;
}
.admin-list-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
}
.admin-list-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 10rem;
  flex: 1 1 160px;
}
.admin-list-meta .meta,
.admin-sol-group .meta { color: var(--muted); font-size: 0.78rem; }
.admin-diff-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
}
.admin-toggle-inline { margin: 0; font-weight: 600; font-size: 0.85rem; }
.admin-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.admin-chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font: 650 0.78rem var(--sans);
  cursor: pointer;
}
.admin-chip.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-ink);
}
.admin-solutions { display: grid; gap: 1.1rem; margin-top: 0.5rem; }
.admin-sol-section header { margin-bottom: 0.55rem; }
.admin-sol-section h4 { margin: 0 0 0.2rem; font: 700 1rem var(--serif); }
.admin-sol-group {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.admin-sol-group > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  justify-content: space-between;
  padding: 0.7rem 0.85rem;
  font-weight: 650;
}
.admin-sol-group > summary::-webkit-details-marker { display: none; }
.admin-sol-items { display: grid; gap: 0.65rem; padding: 0 0.85rem 0.85rem; }
.admin-sol-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
}
.admin-sol-label {
  margin: 0 0 0.25rem;
  font: 700 0.72rem var(--mono);
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.admin-sol-prompt { margin: 0 0 0.45rem; }
.admin-sol-choices {
  margin: 0;
  padding-left: 1.1rem;
}
.admin-sol-choices .is-answer {
  font-weight: 700;
  color: var(--accent-ink);
}
.admin-sol-code {
  margin: 0.45rem 0 0;
  padding: 0.65rem 0.75rem;
  background: var(--bg-deep);
  border-radius: 8px;
  overflow: auto;
  font: 0.82rem/1.45 var(--mono);
  white-space: pre-wrap;
}
.admin-sol-check { margin-top: 0.45rem; }
.admin-sol-check summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.85rem;
}

@media (max-width: 800px) {
  .story-frame { grid-template-columns: 1fr; }
  .admin-grid-2 { grid-template-columns: 1fr; }
  .admin-tabs { top: 0; border-radius: 0; margin-left: -0.25rem; margin-right: -0.25rem; }
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}
.admin-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  box-shadow: var(--shadow);
}
.admin-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin: 0.7rem 0;
}
.admin-stats div {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.65rem;
  text-align: center;
}
.admin-stats b { display: block; font: 700 1.35rem var(--serif); }
.admin-stats span { color: var(--muted); font-size: 0.75rem; }
.admin-trend {
  display: flex;
  align-items: flex-end;
  gap: 0.25rem;
  height: 72px;
  margin-top: 0.5rem;
}
.admin-bar {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--bg-deep);
  border-radius: 4px 4px 0 0;
}
.admin-bar span {
  display: block;
  width: 100%;
  background: linear-gradient(180deg, var(--accent), #2a9d75);
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}
.admin-metrics { list-style: none; margin: 0.5rem 0 0; padding: 0; }
.admin-metrics li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.9rem;
}
.admin-metrics span { color: var(--muted); }
.admin-toggle {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0.65rem 0;
  cursor: pointer;
  font-weight: 600;
}
.admin-table-wrap { overflow: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--surface); }
.admin-table th, .admin-table td {
  border-bottom: 1px solid var(--line);
  padding: 0.65rem 0.55rem;
  text-align: left;
  font-size: 0.88rem;
  vertical-align: top;
}
.admin-actions { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.status-pill {
  display: inline-block;
  font: 700 0.7rem var(--mono);
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
}
.status-approved { background: var(--accent-soft); color: var(--accent-ink); }
.status-pending { background: #fff3d6; color: var(--warn); }
.status-rejected { background: #ffe1de; color: var(--danger); }

.nb-cell {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 1rem 1.1rem;
  margin: 1rem 0;
  border-radius: 12px;
}
.nb-code { width: 100%; min-height: 120px; }
.nb-out { min-height: 48px; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(21, 35, 28, 0.45);
  display: grid;
  place-items: center;
  z-index: 5;
  backdrop-filter: blur(4px);
}
.modal-card {
  width: min(420px, calc(100% - 2rem));
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 1.5rem;
  border-radius: calc(var(--radius) + 4px);
  box-shadow: 0 24px 60px rgba(21, 35, 28, 0.18);
}
.modal-card h3 { font-family: var(--serif); margin-top: 0; }
.modal-card label, .classroom label {
  display: block;
  margin: 0.7rem 0;
  color: var(--muted);
  font-size: 0.84rem;
}
.modal-card input, .classroom input, .classroom select {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 10px;
  font: 500 0.95rem var(--sans);
}
.error { color: var(--danger); font-size: 0.85rem; }

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
th, td {
  border-bottom: 1px solid var(--line);
  padding: 0.6rem 0.45rem;
  text-align: left;
}
.badge-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.badge {
  border: 1px solid var(--line);
  background: var(--surface-2);
  padding: 0.25rem 0.55rem;
  font-size: 0.8rem;
  border-radius: 999px;
}
.lang-wrap select {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 0.4rem 0.5rem;
  font: 600 0.78rem var(--mono);
  border-radius: 8px;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media print {
  .nav, .grid-bg { display: none !important; }
  body { background: #fff; color: #111; }
  .view { display: block !important; }
}

.ch-manage {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface, #fff);
}
.ch-manage summary {
  cursor: pointer;
  font-weight: 700;
}
.ch-manage .admin-campaigns {
  margin-top: 0.75rem;
  max-height: 280px;
  overflow: auto;
}

/* Profile */
.chip-profile { cursor: pointer; }
.chip-profile:hover { filter: brightness(0.97); }
.avatar-sm, .avatar-lg {
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  object-fit: cover;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-weight: 700;
  flex-shrink: 0;
}
.avatar-sm { width: 2rem; height: 2rem; font-size: 0.85rem; }
.avatar-lg { width: 5.5rem; height: 5.5rem; font-size: 1.75rem; border: 3px solid var(--surface); box-shadow: var(--shadow); }
.avatar-fallback { font-family: var(--serif); }
.stat-avatar {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
}
.profile-shell { display: grid; gap: 1.15rem; }
.profile-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.35rem;
  box-shadow: var(--shadow);
}
.profile-avatar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
  margin-top: 0.75rem;
}
.profile-file-btn { margin: 0; cursor: pointer; }
.profile-hint { margin: 0.45rem 0 0; font-size: 0.8rem; }
.profile-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.profile-card h3 {
  margin: 0 0 0.85rem;
  font: 700 1.1rem var(--serif);
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem 1rem;
}
.profile-card label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
}
.profile-card input,
.profile-card select,
.profile-card textarea {
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink);
  border-radius: 10px;
  font: 500 0.95rem var(--sans);
}
.profile-card textarea { resize: vertical; min-height: 4.5rem; }
.profile-span { grid-column: 1 / -1; }
.ok-msg { color: var(--ok); }
.modal-card-wide {
  width: min(720px, calc(100% - 2rem));
  max-height: min(90vh, 900px);
  overflow: auto;
}
.admin-table .avatar-sm { vertical-align: middle; }

/* Active nav */
nav button.nav-active {
  color: var(--accent-ink);
  background: var(--accent-soft);
}

/* Soften noisy game card skins — keep style on art only */
.game-card[class*="style-"] {
  background: var(--surface);
  color: var(--ink);
}
.game-card.style-terminal_noir {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--line);
}

/* Mobile nav */
.nav-toggle {
  display: none;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  color: var(--accent-ink);
  font: 700 0.82rem var(--sans);
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
}
.nav-toggle.has-alerts::after {
  content: "";
  position: absolute;
  top: 4px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--danger);
}
.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(21, 35, 28, 0.35);
  z-index: 3;
}
@media (max-width: 980px) {
  .nav { flex-wrap: wrap; gap: 0.65rem; }
  .nav-toggle { display: inline-flex; margin-left: auto; order: 2; }
  .nav-user { order: 3; width: 100%; justify-content: flex-end; flex-wrap: wrap; }
  nav.nav-menus {
    display: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
    padding: 0.85rem 0 0.35rem;
    border-top: 1px solid var(--line);
    justify-content: flex-start;
  }
  body.nav-open nav.nav-menus { display: flex; }
  .nav-group {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }
  .nav-group-trigger {
    width: 100%;
    justify-content: space-between;
    border-radius: 10px;
    padding: 0.55rem 0.75rem;
    font: 700 0.68rem/1 var(--mono);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #4a5c54;
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    pointer-events: none;
  }
  .nav-group-direct .nav-group-trigger {
    pointer-events: auto;
    font: 700 0.9rem var(--sans);
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
    background: none;
    justify-content: flex-start;
  }
  .nav-chevron { display: none; }
  .nav-panel {
    display: flex;
    position: static;
    transform: none;
    min-width: 0;
    width: 100%;
    box-shadow: none;
    border: 0;
    background: transparent;
    padding: 0.15rem 0 0.35rem;
    border-radius: 0;
  }
  .nav-panel button {
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
  }
  .nav-group.is-open > .nav-group-trigger {
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    color: #4a5c54;
  }
}

/* Hall of Fame */
.hof-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 1rem 0 0.75rem;
}
.hof-course-wrap { margin: 0 0 1rem; }
.hof-course-label {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}
.hof-course-label select {
  min-width: min(100%, 280px);
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  font: 600 0.9rem var(--sans);
  color: var(--ink);
}
.hof-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.55rem;
}
.hof-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  box-shadow: var(--shadow);
}
.hof-row.hof-top {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: linear-gradient(180deg, #fff, #f3faf6);
}
.hof-row.hof-you {
  outline: 2px solid color-mix(in srgb, var(--accent) 50%, transparent);
}
.hof-rank {
  font: 700 1rem var(--mono);
  min-width: 1.75rem;
  text-align: center;
}
.hof-meta { min-width: 0; }
.hof-meta strong {
  display: block;
  font: 700 1rem var(--serif);
}
.hof-xp {
  font: 600 0.85rem var(--mono);
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
}
.hof-xp b { font-size: 1rem; }
.classroom-card { display: block !important; margin-top: 0.75rem; }
.hof-grade-table th { white-space: normal; min-width: 6rem; }

/* What's next */
.next-up { margin: 0 0 1.75rem; }
.next-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
}
.next-card {
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.95rem 1.05rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  color: inherit;
  font: inherit;
  display: grid;
  gap: 0.2rem;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease);
}
.next-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}
.next-card.next-urgent {
  border-color: color-mix(in srgb, var(--danger) 40%, var(--line));
  background: #fff8f7;
}
.next-card strong {
  font: 700 1.02rem/1.25 var(--serif);
}

/* Search */
.nav-search-wrap {
  position: relative;
  min-width: min(220px, 42vw);
}
.nav-search {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font: 500 0.86rem var(--sans);
  color: var(--ink);
}
.nav-search:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-color: var(--accent);
}
.search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  right: 0;
  width: min(360px, 90vw);
  max-height: min(70vh, 420px);
  overflow: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(21, 35, 28, 0.14);
  z-index: 6;
  padding: 0.35rem;
}
.search-hit {
  display: grid;
  gap: 0.1rem;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.search-hit:hover { background: var(--accent-soft); }
.search-empty { padding: 0.75rem; margin: 0; }

/* Gradebook tools */
.gb-reminders { display: grid; gap: 0.4rem; margin: 0.75rem 0; }
.gb-reminder {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  font-size: 0.88rem;
}
.gb-reminder.urgency-high {
  background: #fff5f4;
  border-color: #f0c2bc;
  color: #8f1f14;
}
.gb-reminder.urgency-medium {
  background: #fff8e8;
  border-color: #ecd9a8;
  color: #7a5a12;
}
.gb-toolbar { margin: 0.65rem 0; }
.gb-toolbar select, .bulk-grade-form select {
  margin-top: 0.3rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface);
  font: inherit;
}
.bulk-grade-form {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
@media (max-width: 980px) {
  .nav-search-wrap { min-width: 0; flex: 1; }
}

/* Empty states */
.empty-state {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 1.35rem 1.25rem;
  text-align: left;
  box-shadow: none;
}
.empty-state h3 {
  margin: 0 0 0.35rem;
  font: 700 1.1rem var(--serif);
}
.empty-state p {
  margin: 0 0 0.9rem;
  color: var(--muted);
  max-width: 42ch;
}
.empty-state .empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Share card */
.share-card-panel {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.share-card-panel canvas {
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: block;
  margin: 0.75rem 0;
}
.share-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
