/* ── layout ─────────────────────────────────── */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: var(--bg);
}

body {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
}

/* ── terminal window ────────────────────────── */
#terminal-window {
  flex: 1;
  width: 100%;
  height: auto;
  min-height: 0;
  border-radius: 0;
  border: none;
  overflow: visible;
  box-shadow: none;
  display: flex;
  flex-direction: column;
}

.terminal-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  cursor: text;
}

#output {
  /* natural height — prompt follows immediately after output */
}

/* ── output lines ───────────────────────────── */
.line {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
}

.line.err {
  color: var(--red);
}

/* ── input row ──────────────────────────────── */
.input-line {
  display: flex;
  align-items: baseline;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 2px;
  flex-wrap: nowrap;
}

/* ── PS1 prompt ─────────────────────────────── */
.ps1 {
  white-space: nowrap;
  margin-right: 8px;
}

.ps1-user   { color: var(--green); }
.ps1-sep    { color: var(--dim); }
.ps1-path   { color: #4a9eff; }
.ps1-dollar { color: var(--dim); }

/* ── live input mirror ──────────────────────── */
.input-text {
  color: #e2e8f0;
  white-space: pre;
}

/* ── blinking cursor ────────────────────────── */
.cursor {
  color: var(--green);
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── hidden capture input ───────────────────── */
#hidden-input {
  position: fixed;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  width: 1px;
  height: 1px;
  border: none;
  outline: none;
  padding: 0;
  pointer-events: none;
}

/* ── inline color helpers (used in innerHTML) ── */
.c-green { color: var(--green); }
.c-amber { color: var(--amber); }
.c-red   { color: var(--red); }
.c-blue  { color: #4a9eff; }
.c-dim   { color: var(--dim); }
.c-bold  { font-weight: 600; }

/* ── prompt echo (printed lines) ───────────── */
.echo-user { color: var(--green); }
.echo-path { color: #4a9eff; }
.echo-cmd  { color: #e2e8f0; }
