:root {
  color-scheme: dark;
  --bg: #07100d;
  --bg-deep: #030806;
  --panel: rgba(12, 25, 20, 0.78);
  --panel-solid: #0c1914;
  --panel-raised: #12221b;
  --line: rgba(219, 255, 231, 0.14);
  --line-strong: rgba(156, 255, 87, 0.42);
  --text: #edf7f0;
  --muted: #91a69a;
  --green: #9cff57;
  --green-deep: #305c22;
  --red: #ff5b57;
  --cyan: #5de0e6;
  --yellow: #f4c95d;
  --focus: #ffffff;
  --radius: 6px;
  --sidebar-width: 232px;
  --topbar-height: 68px;
  font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  background: var(--bg);
  color: var(--text);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    linear-gradient(rgba(156, 255, 87, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(156, 255, 87, 0.025) 1px, transparent 1px),
    var(--bg);
  background-size: 28px 28px;
}

button,
input,
textarea {
  font: inherit;
}

button {
  color: inherit;
}

button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--green);
  color: var(--bg-deep);
  font-weight: 700;
}

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

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

.sidebar {
  position: fixed;
  z-index: 20;
  inset: 0 auto 0 0;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: rgba(3, 8, 6, 0.92);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  min-height: var(--topbar-height);
  align-items: center;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 12px 18px;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--green);
  border-radius: var(--radius);
  color: var(--green);
  font-weight: 700;
}

.brand strong,
.brand small {
  display: block;
  letter-spacing: 0;
}

.brand strong {
  font-family: "Space Grotesk", sans-serif;
  font-size: 17px;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.primary-nav {
  display: grid;
  gap: 4px;
  padding: 18px 10px;
}

.nav-item {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 0 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
}

.nav-item svg {
  width: 18px;
  height: 18px;
}

.nav-item:hover {
  border-color: var(--line);
  color: var(--text);
}

.nav-item.is-active {
  border-color: rgba(156, 255, 87, 0.24);
  background: rgba(156, 255, 87, 0.09);
  color: var(--green);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: auto 14px 16px;
  border-top: 1px solid var(--line);
  padding: 16px 4px 0;
}

.sidebar-status small,
.sidebar-status strong {
  display: block;
}

.sidebar-status small {
  color: var(--muted);
  font-size: 9px;
}

.sidebar-status strong {
  margin-top: 3px;
  font-size: 12px;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px rgba(156, 255, 87, 0.75);
}

.workspace {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  height: var(--topbar-height);
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 0 24px;
  background: rgba(7, 16, 13, 0.82);
  backdrop-filter: blur(18px);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.prompt {
  color: var(--green);
}

.breadcrumb strong {
  color: var(--text);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.xp-chip {
  display: flex;
  height: 36px;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(244, 201, 93, 0.24);
  border-radius: var(--radius);
  padding: 0 10px;
  color: var(--yellow);
  font-size: 12px;
}

.xp-chip svg {
  width: 15px;
  height: 15px;
}

.profile-button {
  display: flex;
  height: 44px;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px 0 6px;
  background: rgba(255, 255, 255, 0.025);
  cursor: pointer;
}

.profile-button:hover {
  border-color: var(--line-strong);
}

.profile-button > svg {
  width: 15px;
}

.avatar {
  display: grid;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 50%;
  background: var(--red);
  color: #160605;
  font-weight: 700;
}

.profile-copy {
  min-width: 88px;
  text-align: left;
}

.profile-copy strong,
.profile-copy small {
  display: block;
  max-width: 130px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-copy strong {
  font-size: 12px;
}

.profile-copy small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.icon-button.mobile-menu {
  display: none;
}

main {
  min-height: calc(100vh - var(--topbar-height));
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.content-view {
  width: min(1320px, 100%);
  margin: 0 auto;
  padding: 34px 28px 64px;
}

.hero {
  position: relative;
  min-height: clamp(440px, 68vh, 650px);
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #030806;
}

.hero-image,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-image {
  object-fit: cover;
  object-position: center;
}

.hero-shade {
  background: linear-gradient(
    90deg,
    rgba(3, 8, 6, 0.98) 0%,
    rgba(3, 8, 6, 0.78) 34%,
    rgba(3, 8, 6, 0.15) 72%,
    rgba(3, 8, 6, 0.2) 100%
  );
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  width: min(620px, 62%);
  min-height: inherit;
  flex-direction: column;
  justify-content: center;
  padding: 58px clamp(28px, 6vw, 88px);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: 0;
}

.hero h1 {
  max-width: 580px;
  font-size: clamp(42px, 6vw, 78px);
  line-height: 0.96;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 560px;
  margin: 24px 0 0;
  color: #c8d4cc;
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 30px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-radius: var(--radius);
  padding: 0 16px;
  cursor: pointer;
  font-weight: 700;
}

.primary-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #071005;
}

.primary-button:hover {
  background: #b9ff86;
}

.secondary-button {
  border: 1px solid rgba(237, 247, 240, 0.28);
  background: rgba(7, 16, 13, 0.58);
  color: var(--text);
  backdrop-filter: blur(12px);
}

.secondary-button:hover {
  border-color: var(--text);
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}

.hero-signal {
  position: absolute;
  z-index: 2;
  right: clamp(20px, 4vw, 58px);
  bottom: 26px;
  width: 200px;
  border-left: 2px solid var(--red);
  padding: 4px 0 4px 14px;
  background: rgba(3, 8, 6, 0.5);
  backdrop-filter: blur(8px);
}

.hero-signal span,
.hero-signal strong,
.hero-signal small {
  display: block;
}

.hero-signal span {
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
}

.hero-signal strong {
  margin-top: 5px;
  font-size: 13px;
}

.hero-signal small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.dashboard-grid {
  display: grid;
  width: min(1320px, 100%);
  margin: 0 auto;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 42px;
  padding: 38px 28px 64px;
}

.section-heading,
.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
}

.section-heading h2 {
  font-size: 22px;
}

.page-heading {
  margin-bottom: 30px;
}

.page-heading h1 {
  font-size: clamp(34px, 5vw, 56px);
}

.page-heading > div > p:last-child {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.page-actions a {
  text-decoration: none;
}

.github-status {
  min-height: 360px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(3, 8, 6, 0.32);
}

.github-loading,
.github-error {
  display: flex;
  min-height: 360px;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 28px;
  color: var(--muted);
  text-align: center;
}

.github-loading svg {
  width: 22px;
  animation: spin 900ms linear infinite;
  color: var(--green);
}

.github-error svg {
  width: 30px;
  color: var(--red);
}

.github-error h2 {
  font-size: 20px;
}

.github-error p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.github-repository {
  display: flex;
  min-height: 132px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 24px;
}

.github-repository h2 {
  font-size: 26px;
}

.github-repository > div > p:last-child {
  max-width: 700px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.api-status {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.api-status svg {
  width: 15px;
}

.github-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.github-metrics article {
  position: relative;
  min-width: 0;
  padding: 22px;
}

.github-metrics article + article {
  border-left: 1px solid var(--line);
}

.github-metrics svg {
  position: absolute;
  top: 22px;
  right: 20px;
  width: 17px;
  color: var(--cyan);
}

.github-metrics span,
.github-metrics strong {
  display: block;
}

.github-metrics span {
  padding-right: 24px;
  color: var(--muted);
  font-size: 10px;
}

.github-metrics strong {
  margin-top: 12px;
  overflow: hidden;
  color: var(--green);
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.github-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 18px 24px;
}

.github-details > div {
  min-width: 0;
  padding: 4px 18px 4px 0;
}

.github-details span,
.github-details strong,
.github-details a {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.github-details span {
  color: var(--muted);
  font-size: 9px;
}

.github-details strong,
.github-details a {
  margin-top: 7px;
  color: var(--text);
  font-size: 11px;
}

.github-details a {
  color: var(--yellow);
}

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

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 18px;
}

.stat {
  min-width: 0;
  padding: 20px 18px;
}

.stat + .stat {
  border-left: 1px solid var(--line);
}

.stat span,
.stat strong,
.stat small {
  display: block;
}

.stat span,
.stat small {
  color: var(--muted);
  font-size: 10px;
}

.stat strong {
  margin: 8px 0 4px;
  color: var(--green);
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(24px, 4vw, 38px);
}

.empty-state {
  display: flex;
  min-height: 146px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  margin-top: 18px;
  padding: 20px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 24px;
  color: var(--cyan);
}

.filter-bar,
.auth-tabs {
  display: inline-flex;
  min-height: 38px;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.segment {
  border: 0;
  border-right: 1px solid var(--line);
  padding: 0 13px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.segment:last-child {
  border-right: 0;
}

.segment.is-active {
  background: var(--green);
  color: var(--bg-deep);
  font-weight: 700;
}

.mission-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mission-card {
  position: relative;
  display: flex;
  min-height: 330px;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(12, 25, 20, 0.64);
  backdrop-filter: blur(12px);
}

.mission-card:hover {
  border-color: var(--line-strong);
  background: rgba(18, 34, 27, 0.82);
}

.mission-card.is-complete {
  border-color: rgba(93, 224, 230, 0.38);
}

.mission-card.is-complete::before {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  width: 34px;
  height: 3px;
  background: var(--cyan);
  content: "";
}

.mission-card.is-disabled {
  opacity: 0.56;
}

.mission-card.is-disabled .mission-open {
  cursor: not-allowed;
}

.mission-card-topline {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 9px;
  text-transform: uppercase;
}

.mission-card-topline span {
  color: var(--muted);
}

.mission-card-topline strong {
  color: var(--yellow);
}

.mission-index {
  position: absolute;
  right: 12px;
  top: 30px;
  color: rgba(237, 247, 240, 0.055);
  font-family: "Space Grotesk", sans-serif;
  font-size: 90px;
  font-weight: 700;
  line-height: 1;
}

.mission-module {
  position: relative;
  z-index: 1;
  margin: 44px 0 8px;
  color: var(--red);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}

.mission-card h2 {
  position: relative;
  z-index: 1;
  max-width: 90%;
  font-size: 22px;
  line-height: 1.12;
}

.mission-card > p:not(.mission-module) {
  position: relative;
  z-index: 1;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.mission-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--muted);
  font-size: 10px;
}

.mission-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.mission-meta svg {
  width: 13px;
  height: 13px;
  color: var(--cyan);
}

.mission-open {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  border: 0;
  border-top: 1px solid var(--line);
  margin: 15px -18px -18px;
  padding: 0 18px;
  background: rgba(3, 8, 6, 0.35);
  color: var(--green);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
}

.mission-open:hover {
  background: rgba(156, 255, 87, 0.08);
}

.mission-open svg {
  width: 16px;
}

.next-mission {
  display: flex;
  min-height: 146px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-top: 18px;
  padding: 20px 2px;
}

.next-mission span {
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
}

.next-mission h3 {
  margin-top: 8px;
  font-size: 20px;
}

.next-mission p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.lab-layout {
  display: grid;
  min-height: 560px;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.editor-pane,
.console-pane {
  min-width: 0;
  background: rgba(3, 8, 6, 0.7);
}

.editor-pane {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
}

.editor-pane > span,
.console-titlebar {
  display: flex;
  min-height: 43px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
  color: var(--muted);
  font-size: 11px;
}

.editor-pane textarea {
  flex: 1;
  resize: none;
  border: 0;
  padding: 20px;
  outline: 0;
  background: transparent;
  color: #d9ffe2;
  font-size: 14px;
  line-height: 1.7;
  tab-size: 2;
}

.console-pane {
  display: flex;
  flex-direction: column;
}

.console-titlebar {
  justify-content: space-between;
}

.console-pane pre {
  flex: 1;
  overflow: auto;
  margin: 0;
  padding: 20px;
  color: var(--green);
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.terminal-command {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  border-top: 1px solid var(--line);
  padding: 0 14px;
  color: var(--green);
}

.terminal-command input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
}

.terminal-command input::placeholder {
  color: #5d7063;
}

.icon-button {
  display: inline-grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--line-strong);
  color: var(--green);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.table-shell {
  min-height: 240px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.ranking-note {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

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

.table-shell table {
  width: 100%;
  min-width: 650px;
  border-collapse: collapse;
}

.table-shell th,
.table-shell td {
  border-bottom: 1px solid var(--line);
  padding: 15px 12px;
  text-align: left;
}

.table-shell th {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.table-shell td {
  font-size: 12px;
}

.table-shell td strong,
.table-shell td small {
  display: block;
}

.table-shell td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.table-shell tr.is-current {
  background: rgba(156, 255, 87, 0.07);
}

.rank-position {
  width: 58px;
  color: var(--muted);
}

.rank-xp {
  color: var(--yellow);
  font-weight: 700;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.admin-stats article {
  padding: 22px 18px;
}

.admin-stats article + article {
  border-left: 1px solid var(--line);
}

.admin-stats span,
.admin-stats strong {
  display: block;
}

.admin-stats span {
  color: var(--muted);
  font-size: 10px;
}

.admin-stats strong {
  margin-top: 8px;
  color: var(--green);
  font-family: "Space Grotesk", sans-serif;
  font-size: 30px;
}

.admin-section {
  margin-top: 42px;
}

.admin-section h2 {
  font-size: 22px;
}

.admin-mission-list {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.admin-mission-row {
  display: grid;
  min-height: 68px;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 110px 90px;
  gap: 18px;
  border-bottom: 1px solid var(--line);
  padding: 9px 4px;
}

.admin-mission-row > div strong,
.admin-mission-row > div span {
  display: block;
}

.admin-mission-row > div strong {
  font-size: 12px;
}

.admin-mission-row > div span,
.admin-mission-row label > span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
}

.admin-mission-row label {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-mission-row input[type="number"] {
  width: 72px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 8px;
  background: var(--bg-deep);
  color: var(--text);
}

.switch-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--green);
}

.danger-zone {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 22px;
  border-top: 1px solid rgba(255, 91, 87, 0.35);
  padding-top: 22px;
}

.danger-zone p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.danger-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid var(--red);
  border-radius: var(--radius);
  padding: 0 14px;
  background: rgba(255, 91, 87, 0.08);
  color: #ff8e8b;
  cursor: pointer;
  font-weight: 700;
}

.danger-button:hover {
  background: rgba(255, 91, 87, 0.16);
}

.danger-button svg {
  width: 17px;
}

.modal {
  width: min(520px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 0;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.58);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(7px);
}

.modal-shell {
  display: grid;
  gap: 16px;
  margin: 0;
  padding: 24px;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.modal-header h2 {
  font-size: 25px;
}

.modal-shell label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.modal-shell input {
  min-height: 43px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--bg-deep);
  color: var(--text);
}

.modal-shell input:focus {
  border-color: var(--green);
}

.form-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-error {
  min-height: 17px;
  margin: -3px 0 0;
  color: var(--red);
  font-size: 11px;
  line-height: 1.5;
}

#auth-fields {
  display: grid;
  gap: 16px;
}

.session-panel {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 8px 0 2px;
  text-align: center;
}

.session-avatar {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  margin-bottom: 6px;
  background: rgba(156, 255, 87, 0.08);
  color: var(--green);
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  font-weight: 700;
}

.session-panel > span:not(.session-avatar),
.session-panel small {
  color: var(--muted);
  font-size: 11px;
}

.session-panel .secondary-button {
  margin-top: 16px;
}

.full-width {
  width: 100%;
}

.mission-modal {
  width: min(900px, calc(100% - 28px));
}

.mission-shell {
  max-height: calc(100vh - 30px);
  overflow-y: auto;
}

.mission-shell .modal-header h2 {
  font-size: clamp(28px, 5vw, 46px);
}

.mission-lead {
  max-width: 700px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.mission-brief {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 28px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.mission-brief h3 {
  font-size: 15px;
}

.mission-brief p,
.mission-brief li {
  color: #b5c6bb;
  font-size: 12px;
  line-height: 1.65;
}

.mission-brief p {
  margin: 9px 0 0;
}

.mission-brief ul {
  margin: 9px 0 0;
  padding-left: 18px;
}

.starter-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-deep);
}

.code-titlebar {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding: 0 12px;
  color: var(--muted);
  font-size: 9px;
}

.starter-preview pre {
  max-height: 260px;
  overflow: auto;
  margin: 0;
  padding: 16px;
  color: #caffd8;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.mission-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.hint-box {
  border-left: 2px solid var(--yellow);
  margin: 0;
  padding: 10px 12px;
  background: rgba(244, 201, 93, 0.08);
  color: #f7dda0;
  font-size: 11px;
  line-height: 1.55;
}

.toast-region {
  position: fixed;
  z-index: 80;
  right: 18px;
  bottom: 18px;
  display: grid;
  width: min(360px, calc(100% - 36px));
  gap: 8px;
}

.toast {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 13px 15px;
  background: var(--panel-solid);
  color: var(--text);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
  font-size: 12px;
}

.root-mode {
  --green: #ff706c;
  --line-strong: rgba(255, 91, 87, 0.5);
}

.matrix-mode::after {
  position: fixed;
  z-index: 70;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent 0,
    transparent 7px,
    rgba(156, 255, 87, 0.05) 8px
  );
  content: "";
  animation: scan-lines 5s linear infinite;
}

.tomatin-party .brand-mark {
  animation: tomato-signal 600ms steps(2, end) infinite;
}

.secret-pulse .workspace {
  animation: secret-pulse 850ms ease-out;
}

@keyframes scan-lines {
  from {
    transform: translateY(-8px);
  }
  to {
    transform: translateY(8px);
  }
}

@keyframes tomato-signal {
  0%,
  100% {
    border-color: var(--green);
    color: var(--green);
  }
  50% {
    border-color: var(--red);
    color: var(--red);
  }
}

@keyframes secret-pulse {
  0% {
    filter: none;
  }
  40% {
    filter: saturate(1.7) brightness(1.16);
  }
  100% {
    filter: none;
  }
}

[hidden] {
  display: none !important;
}

@media (max-width: 980px) {
  :root {
    --sidebar-width: 204px;
  }

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

  .hero-copy {
    width: min(680px, 72%);
  }

  .dashboard-grid,
  .lab-layout {
    grid-template-columns: 1fr;
  }

  .editor-pane {
    min-height: 420px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .console-pane {
    min-height: 280px;
  }

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

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

  .github-metrics article:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .github-metrics article:nth-child(4) {
    border-top: 1px solid var(--line);
  }

  .admin-stats article:nth-child(3) {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .admin-stats article:nth-child(4) {
    border-top: 1px solid var(--line);
  }
}

@media (max-width: 720px) {
  :root {
    --topbar-height: 60px;
  }

  .sidebar {
    width: min(280px, 82vw);
    transform: translateX(-102%);
    transition: transform 180ms ease;
  }

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

  .workspace {
    margin-left: 0;
  }

  .topbar {
    padding: 0 12px;
  }

  .icon-button.mobile-menu {
    display: inline-grid;
  }

  .breadcrumb .prompt,
  .breadcrumb > span:nth-child(2),
  .xp-chip span,
  .profile-copy {
    display: none;
  }

  .xp-chip {
    padding: 0 8px;
  }

  .profile-button {
    width: 43px;
    padding: 0;
    justify-content: center;
  }

  .profile-button > svg {
    display: none;
  }

  .hero {
    min-height: 620px;
  }

  .hero-image {
    object-position: 66% center;
  }

  .hero-shade {
    background: linear-gradient(
      0deg,
      rgba(3, 8, 6, 0.98) 0%,
      rgba(3, 8, 6, 0.85) 45%,
      rgba(3, 8, 6, 0.18) 100%
    );
  }

  .hero-copy {
    width: 100%;
    min-height: inherit;
    justify-content: flex-end;
    padding: 32px 20px 112px;
  }

  .hero h1 {
    font-size: 46px;
  }

  .hero-signal {
    right: 20px;
    bottom: 22px;
    left: 20px;
    width: auto;
  }

  .dashboard-grid,
  .content-view {
    padding-right: 18px;
    padding-left: 18px;
  }

  .stat-row {
    grid-template-columns: 1fr;
  }

  .stat + .stat {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .page-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-bar {
    align-self: flex-start;
  }

  .page-actions {
    justify-content: flex-start;
  }

  .github-repository {
    align-items: flex-start;
    flex-direction: column;
  }

  .github-metrics,
  .github-details {
    grid-template-columns: 1fr;
  }

  .github-metrics article + article {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .github-details > div {
    padding: 10px 0;
  }

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

  .mission-brief {
    grid-template-columns: 1fr;
  }

  .admin-mission-row {
    grid-template-columns: minmax(0, 1fr) 96px;
  }

  .admin-mission-row .switch-label {
    grid-column: 1 / -1;
  }

  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions {
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
