:root {
  --bg: #0b0d10;
  --panel: #11141a;
  --sidebar: #0e1116;
  --border: #1e2430;
  --text: #d7dde8;
  --muted: #7a8499;
  --accent: #6ee7a8;
  --accent-dim: #3d8f68;
  --warn: #e6c07b;
  --tab: #161b24;
  --mono: "SF Mono", "Cascadia Code", "Consolas", "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-title {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 0.08em;
  font-size: 12px;
}
.tree { list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 12px; }
.tree ul { list-style: none; margin: 0.2rem 0 0.4rem 0.9rem; padding: 0; }
.tree .folder { color: var(--text); margin-bottom: 0.35rem; }
.tree .file { padding: 0.15rem 0.35rem; border-radius: 3px; }
.tree .file.active {
  background: #1a2230;
  color: var(--accent);
}
.sidebar-foot {
  margin-top: auto;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0.35rem 0.5rem 0;
}
.tab {
  background: var(--tab);
  border: 1px solid var(--border);
  border-bottom: none;
  padding: 0.4rem 0.85rem;
  font-size: 12px;
  color: var(--muted);
  border-radius: 4px 4px 0 0;
}
.tab.active { color: var(--text); background: var(--panel); }
.tab.dim { opacity: 0.55; }

.editor {
  flex: 1;
  background: var(--panel);
  padding: 1.5rem 1.75rem 2.5rem;
  max-width: 820px;
}

h1 {
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 600;
  margin: 0.75rem 0 0.5rem;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  color: var(--text);
}
.hash { color: var(--accent-dim); margin-right: 0.35rem; }

.ticker { margin: 0 0 1rem; color: var(--muted); }
.ticker .prompt { color: var(--accent); margin-right: 0.35rem; }
.ticker strong { color: var(--accent); }
.muted { color: var(--muted); }

.lede {
  color: var(--text);
  max-width: 54ch;
  margin: 0 0 0.5rem;
}

.ascii {
  margin: 0;
  color: var(--accent-dim);
  font-size: 12px;
  line-height: 1.35;
  white-space: pre;
  overflow-x: auto;
}
.ascii.roadmap { color: var(--text); margin-top: 0.25rem; }

.term {
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: #0a0c10;
  margin-bottom: 1rem;
}
.term-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.75rem;
  background: #12161e;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  color: var(--muted);
}
.term-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent-dim);
}
.term-body {
  margin: 0;
  padding: 0.9rem 1rem 1.1rem;
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-x: auto;
}
.term-body .cmt { color: var(--muted); }
.term-body .prm { color: var(--accent); }
.term-body .ok { color: var(--warn); }
.cursor {
  display: inline-block;
  color: var(--accent);
  font-weight: 700;
}

.svc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}
.svc-list li {
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #0d1016;
  color: var(--muted);
}
.svc-list code {
  color: var(--accent);
  margin-right: 0.35rem;
}

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  padding: 0.4rem 1rem;
  background: #0c5c3a;
  color: #d7ffe8;
  font-size: 11px;
  border-top: 1px solid #147a4e;
}
.status a { color: #fff; margin-left: auto; }

@media (max-width: 720px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .editor { padding: 1.1rem 1rem 2rem; }
  .status a { margin-left: 0; }
}
