:root {
  color-scheme: light dark;
  --background: #ffffff;
  --surface: #f5f5f2;
  --surface-strong: #e9e9e4;
  --text: #111111;
  --muted: #60605a;
  --line: #b8b8b0;
  --accent: #006b4f;
  --accent-contrast: #ffffff;
  --error: #a72727;
}

:root[data-theme="dark"] {
  --background: #0f0f0f;
  --surface: #181a19;
  --surface-strong: #232624;
  --text: #f1f1ed;
  --muted: #aaa9a2;
  --line: #4f514d;
  --accent: #79d9b4;
  --accent-contrast: #07140f;
  --error: #ff8f87;
}

* { box-sizing: border-box; }

html { background: var(--background); }

body {
  margin: 0;
  min-width: 280px;
  background: var(--background);
  color: var(--text);
  font-family: "Space Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
  line-height: 1.65;
}

button, input { font: inherit; }

button { cursor: pointer; }

.bot-zone {
  width: min(100%, 980px);
  margin: 0 auto;
  padding: clamp(20px, 4vw, 56px) clamp(16px, 4vw, 48px) 72px;
}

.zone-header {
  padding: 0 0 28px;
  border-bottom: 2px solid var(--text);
}

.zone-header h1 {
  margin: 2px 0 4px;
  font-size: clamp(2.3rem, 7vw, 5rem);
  line-height: 1;
  letter-spacing: -0.07em;
}

.zone-header p { margin: 0; color: var(--muted); }
.zone-kicker { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.75rem; }

.zone-section {
  padding: 30px 0;
  border-bottom: 1px solid var(--line);
}

.zone-section p { max-width: 84ch; }
.zone-section h3 { margin: 24px 0 6px; font-size: 0.9rem; }
.zone-section ul:not(.tree) { margin: 0; padding-left: 1.4rem; }

.file-title {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading .file-title { margin: 0; }

.tree {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tree a {
  display: inline-flex;
  color: var(--text);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.tree a::before { content: "├─ "; color: var(--muted); }
.tree li:last-child a::before { content: "└─ "; }
.tree a:hover, .tree a:focus-visible { color: var(--accent); text-decoration: underline; }

.output {
  min-height: 150px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.command-runner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
}

input, button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--text);
}

input { width: 100%; padding: 10px 13px; }
button { padding: 9px 14px; }
button:hover:not(:disabled), button:focus-visible { border-color: var(--accent); }
button:disabled { cursor: not-allowed; opacity: 0.5; }

.run-button {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
}

.suggestions {
  min-height: 1.6em;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.8rem;
}

.suggestions button {
  min-height: 0;
  margin: 4px 6px 0 0;
  padding: 3px 8px;
  font-size: 0.75rem;
}

.command-list { display: grid; gap: 10px; }

.command-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.command-card code { color: var(--accent); font-weight: 700; }
.command-card p { margin: 3px 0 0; color: var(--muted); font-size: 0.82rem; }
.command-card button { min-height: 36px; padding: 5px 10px; }

.output--error { color: var(--error); }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 560px) {
  .command-runner, .command-card { grid-template-columns: 1fr; }
  .command-card button { justify-self: start; }
}
