/* ── Reset ──────────────────────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Tokens ─────────────────────────────────────────────────────────────── */
:root {
  --bg: #0d0f0e;
  /* near-black with a green tint              */
  --surface: #131614;
  /* slightly lighter surface                  */
  --border: #232824;
  /* subtle border                             */
  --accent: #39d353;
  /* GitHub-contributions green                */
  --accent-dim: #1a6626;
  /* dimmed green for secondary chrome         */
  --text: #d4d8d3;
  /* off-white body text                       */
  --text-muted: #5a6358;
  /* muted labels                              */
  --bar-h: 36px;
  --font-ui: "JetBrains Mono", "Fira Code", "Cascadia Code",
    ui-monospace, monospace;
}

/* ── Base ────────────────────────────────────────────────────────────────── */
html,
body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout shell ────────────────────────────────────────────────────────── */
.layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ── Top bar ─────────────────────────────────────────────────────────────── */
.topbar {
  flex-shrink: 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  user-select: none;
}

.topbar-logo {
  font-size: 18px;
  color: var(--accent);
  line-height: 1;
}

.topbar-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text);
}

.topbar-badge {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--accent-dim);
  color: var(--accent);
  letter-spacing: 0.03em;
}

/* ── Terminal wrapper ────────────────────────────────────────────────────── */
.terminal-wrap {
  flex: 1;
  overflow: hidden;
  /* xterm manages its own scroll                */
  padding: 8px 12px;
}

#terminal {
  height: 100%;
}

/* Make xterm's canvas background match our page bg */
.xterm,
.xterm-viewport,
.xterm-screen {
  background: transparent !important;
}

/* ── Status bar ──────────────────────────────────────────────────────────── */
.statusbar {
  flex-shrink: 0;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  user-select: none;
}

.statusbar-hint {
  display: flex;
  align-items: center;
  gap: 4px;
}

kbd {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg);
  font-family: inherit;
  font-size: 11px;
  color: var(--accent);
  line-height: 18px;
}

/* ── Scrollbar (Webkit) ──────────────────────────────────────────────────── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}