:root {
  color-scheme: dark;
  --bg: #090b0a;
  --surface: #0d100e;
  --surface-2: #111512;
  --text: #f0f2ed;
  --muted: #8c938d;
  --faint: #555d57;
  --line: #687069;
  --line-strong: #a4aaa5;
  --accent: #b7f52e;
  --accent-soft: #91bd2e;
  --black: #050605;
  --mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  background: var(--black);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--black);
  color: var(--text);
  font: 15px/1.34 var(--mono);
}

a {
  color: inherit;
}

button,
code {
  font: inherit;
}

button {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 10;
  top: 0;
  left: 1rem;
  padding: 0.65rem 1rem;
  translate: 0 -120%;
  background: var(--accent);
  color: var(--black);
}

.skip-link:focus {
  translate: 0;
}

.app-shell {
  width: min(1920px, 100%);
  min-height: 100svh;
  margin: 0 auto;
  padding: 14px 18px 12px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  background: var(--bg);
}

.topbar {
  min-height: 42px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  border-bottom: 1px dashed var(--line-strong);
}

.brand {
  width: fit-content;
  font-weight: 700;
  text-decoration: none;
}

.brand span,
.pane-title b,
.prompt,
.intro-index,
.requirements h3,
.feature-line h3 {
  color: var(--accent);
}

.mode-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 3vw, 2.75rem);
}

.mode-nav a {
  padding: 2px 8px;
  text-decoration: none;
}

.mode-nav a:hover,
.mode-nav a:focus-visible {
  color: var(--accent);
}

.mode-nav a.active {
  background: var(--text);
  color: var(--black);
  font-weight: 700;
}

.host {
  justify-self: end;
  color: var(--muted);
}

.intro {
  padding: 14px 0 16px;
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  column-gap: 1rem;
  align-items: baseline;
  border-bottom: 1px dashed var(--line);
}

.intro-index {
  grid-row: span 2;
  margin: 0;
}

.intro h1 {
  margin: 0 0 3px;
  font-size: clamp(1.15rem, 2vw, 1.55rem);
  line-height: 1;
}

.intro > p:last-child {
  max-width: 72ch;
  margin: 0;
  color: var(--muted);
}

.workspace {
  min-height: 0;
  padding: 10px 0;
  display: grid;
  grid-template-columns: clamp(230px, 20vw, 315px) minmax(0, 1fr);
  gap: 12px;
}

.session-map {
  min-width: 0;
  padding-right: 12px;
  border-right: 1px dashed var(--line-strong);
}

.map-heading {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.map-mode {
  margin: 8px 0;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line);
  font-weight: 700;
}

.session-map nav {
  display: grid;
}

.session-map nav a {
  padding: 3px 8px;
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  text-decoration: none;
}

.session-map nav a span {
  color: var(--muted);
}

.session-map nav a:hover,
.session-map nav a:focus-visible {
  color: var(--accent);
}

.session-map nav a.active {
  background: var(--accent);
  color: var(--black);
  font-weight: 700;
}

.session-map nav a.active span {
  color: var(--black);
}

.map-hint {
  margin-top: 18px;
  color: var(--muted);
}

.terminal-pane {
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.pane-title {
  min-height: 35px;
  padding: 7px 12px;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px dashed var(--line-strong);
}

.pane-stat {
  color: var(--muted);
}

.objective {
  padding: 9px 12px 10px;
  border-bottom: 1px dashed var(--line-strong);
}

.objective p,
.objective h2 {
  margin: 0;
}

.objective > p:first-child {
  color: var(--muted);
}

.objective h2 {
  font-size: 1rem;
}

.objective-help {
  color: var(--muted);
}

.objective code {
  color: var(--accent);
}

.transcript {
  min-height: clamp(520px, 65vh, 860px);
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
}

.transcript > p {
  margin: 0;
}

.transcript > p:nth-child(2) {
  color: var(--muted);
}

.method-list {
  margin-top: 18px;
  display: grid;
  gap: 9px;
}

.method {
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  border-top: 1px dashed var(--faint);
}

.method-meta {
  min-width: 0;
  padding: 8px 10px 8px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.method h3 {
  margin: 0;
  font-size: 1rem;
}

.method.active h3 {
  color: var(--accent);
}

.channel {
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.channel.ready {
  color: var(--accent-soft);
}

.command {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  display: grid;
  grid-template-columns: 1rem minmax(0, 1fr) 4.5rem;
  align-items: start;
  gap: 0.5rem;
  border: 0;
  border-left: 1px dashed var(--faint);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.command code {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}

.copy-label {
  justify-self: end;
  color: var(--muted);
}

.command:hover,
.command:focus-visible,
.method.active .command {
  background: var(--surface-2);
  outline: none;
}

.command:hover .copy-label,
.command:focus-visible .copy-label,
.method.active .copy-label {
  color: var(--accent);
}

.command.copied {
  background: var(--accent);
  color: var(--black);
}

.command.copied code,
.command.copied .copy-label,
.command.copied .prompt {
  color: var(--black);
}

.output {
  min-height: 2.2rem;
  margin-top: 14px;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
  color: var(--accent);
}

.cursor {
  width: 0.62em;
  height: 1.1em;
  margin-left: 0.35em;
  display: inline-block;
  vertical-align: -0.18em;
  background: var(--accent);
  animation: blink 1s steps(1) infinite;
}

.requirements,
.feature-line {
  margin-top: auto;
  padding-top: 9px;
  border-top: 1px dashed var(--line);
}

.feature-line {
  margin-top: 12px;
}

.requirements h3,
.requirements p,
.feature-line h3,
.feature-line p {
  margin: 0;
}

.feature-line a:hover,
.feature-line a:focus-visible {
  color: var(--accent);
}

.content-pane {
  min-width: 0;
  border: 1px solid var(--line-strong);
  background: var(--surface);
}

.content-transcript {
  min-height: clamp(600px, 72vh, 900px);
  padding: 10px 12px 16px;
  display: flex;
  flex-direction: column;
}

.content-transcript > p,
.content-transcript h2,
.content-transcript h3 {
  margin: 0;
}

.content-transcript > p + p {
  margin-top: 3px;
}

.content-block {
  padding: 13px 0;
  display: grid;
  grid-template-columns: 13rem minmax(0, 1fr);
  border-top: 1px dashed var(--line);
}

.content-block:first-of-type {
  margin-top: 18px;
}

.content-block h2,
.content-block h3 {
  color: var(--accent);
  font-size: 1rem;
}

.content-block div > p {
  max-width: 82ch;
  margin: 0;
}

.content-block div > p + p {
  margin-top: 8px;
  color: var(--muted);
}

.mode-list {
  display: grid;
}

.mode-row {
  padding: 7px 0;
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  border-bottom: 1px dashed var(--faint);
}

.mode-row:last-child {
  border-bottom: 0;
}

.mode-row strong {
  color: var(--accent);
}

.content-cta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}

.content-cta a {
  color: var(--accent);
}

.content-cta a:hover,
.content-cta a:focus-visible {
  background: var(--accent);
  color: var(--black);
  outline: none;
}

.statusbar {
  min-height: 31px;
  padding-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 1.25rem;
  border-top: 1px dashed var(--line-strong);
  color: var(--muted);
}

.statusbar > span:first-child {
  color: var(--accent);
  font-weight: 700;
}

.statusbar button,
.dialog-title button {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  cursor: pointer;
}

.statusbar button:hover,
.statusbar button:focus-visible,
.dialog-title button:hover,
.dialog-title button:focus-visible {
  color: var(--accent);
  outline: none;
}

dialog {
  width: min(560px, calc(100% - 2rem));
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

dialog::backdrop {
  background: rgb(0 0 0 / 72%);
}

dialog form {
  padding: 12px;
}

.dialog-title {
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed var(--line);
}

.dialog-title h2 {
  margin: 0;
  color: var(--accent);
  font-size: 1rem;
}

dialog dl {
  margin: 8px 0 0;
}

dialog dl div {
  padding: 5px 0;
  display: grid;
  grid-template-columns: 6rem 1fr;
}

dialog dt {
  color: var(--accent);
}

dialog dd {
  margin: 0;
  color: var(--muted);
}

@keyframes blink {
  50% { opacity: 0; }
}

@media (max-width: 900px) {
  .topbar {
    grid-template-columns: auto 1fr;
  }

  .mode-nav {
    justify-self: end;
    gap: 0.5rem;
  }

  .host,
  .session-map {
    display: none;
  }

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

  .method {
    grid-template-columns: 10rem minmax(0, 1fr);
  }
}

@media (max-width: 620px) {
  body {
    font-size: 13px;
  }

  .app-shell {
    padding: 8px;
  }

  .topbar {
    padding-bottom: 6px;
    display: block;
  }

  .mode-nav {
    margin-top: 8px;
    justify-content: space-between;
    overflow-x: auto;
  }

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

  .intro-index {
    grid-row: auto;
    margin-bottom: 6px;
  }

  .pane-stat,
  .objective-help {
    display: none;
  }

  .transcript {
    min-height: 0;
  }

  .method {
    display: block;
  }

  .content-block {
    display: block;
  }

  .content-block h2,
  .content-block h3 {
    margin-bottom: 6px;
  }

  .mode-row {
    grid-template-columns: 6.5rem 1fr;
  }

  .method-meta {
    padding-bottom: 2px;
  }

  .command {
    border-left: 0;
    grid-template-columns: 1rem minmax(0, 1fr) 3rem;
  }

  .statusbar {
    grid-template-columns: 1fr auto;
  }

  .statusbar > span:last-child {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; }
}
