:root {
  --bg: #f5f5f5;
  --fg: #1a1a1a;
  --dim: #6a6a6a;
  --accent: #0a84ff;
  --error: #d70015;
  --font: "SFMono-Regular", "Menlo", "Consolas", "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  --bg: #0d0d0d;
  --fg: #e8e8e8;
  --dim: #888888;
  --accent: #4fc3f7;
  --error: #ff6b6b;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0d0d;
    --fg: #e8e8e8;
    --dim: #888888;
    --accent: #4fc3f7;
    --error: #ff6b6b;
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
}

body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg);
}

#terminal {
  min-height: 100vh;
  padding: 24px;
  cursor: text;
}

#output {
  white-space: pre-wrap;
  word-break: break-word;
}

#output .line {
  margin: 0 0 2px 0;
}

#output .cmd-line .prompt {
  color: var(--accent);
  margin-right: 8px;
}

#output .cmd-line .typed {
  color: var(--fg);
}

#output .dim {
  color: var(--dim);
}

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

#output a {
  color: var(--accent);
}

.input-line {
  display: flex;
  align-items: center;
  margin-top: 2px;
}

.prompt {
  color: var(--accent);
  margin-right: 8px;
  white-space: nowrap;
}

#input {
  flex: 0 0 auto;
  width: 0;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font: inherit;
  caret-color: transparent;
  padding: 0;
}

.cursor {
  display: inline-block;
  width: 8px;
  height: 1.1em;
  background: var(--fg);
  margin-left: 1px;
  animation: blink 1s steps(1) infinite;
}

.input-line.blurred .cursor {
  animation: none;
  opacity: 0.4;
}

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