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

html, body {
  height: 100%;
  background: #0d0d0d;
  color: #e0e0e0;
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.4;
  overflow: hidden;
}

#terminal {
  width: 100%;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px;
}

#terminal::-webkit-scrollbar { width: 6px; }
#terminal::-webkit-scrollbar-track { background: #0d0d0d; }
#terminal::-webkit-scrollbar-thumb { background: #444; border-radius: 3px; }

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

/* Must match the box model of committed .output-line elements inside #output
   (block, same white-space / wrapping) so a typed line doesn't shift position
   when it is echoed on Enter. */
#input-line {
  display: block;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 1.4em;
}

#prompt-display { color: #4af626; }
#input-display, #after-display { color: #e0e0e0; }

#cursor {
  display: inline-block;
  position: relative;
  width: 0;
  height: 1.1em;
  vertical-align: text-bottom;
}
/* Draw the I-beam as a zero-width overlay so it takes no advance width —
   moving the caret through a word doesn't nudge the surrounding letters. */
#cursor::after {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  width: 2px;
  height: 1.1em;
  background: #e0e0e0;
  animation: blink 1.5s step-end infinite;
}
#cursor.hidden { display: none; }

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

#hidden-input {
  position: fixed;
  left: -9999px;
  top: -9999px;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* ANSI colors */
.fg-black   { color: #000000; }
.fg-red     { color: #cc0000; }
.fg-green   { color: #4af626; }
.fg-yellow  { color: #c4a000; }
.fg-blue    { color: #3465a4; }
.fg-magenta { color: #75507b; }
.fg-cyan    { color: #06989a; }
.fg-white   { color: #d3d7cf; }
.fg-bright-black   { color: #555753; }
.fg-bright-red     { color: #ef2929; }
.fg-bright-green   { color: #8ae234; }
.fg-bright-yellow  { color: #fce94f; }
.fg-bright-blue    { color: #729fcf; }
.fg-bright-magenta { color: #ad7fa8; }
.fg-bright-cyan    { color: #34e2e2; }
.fg-bright-white   { color: #eeeeec; }

.bg-black   { background: #000000; }
.bg-red     { background: #cc0000; }
.bg-green   { background: #4af626; }
.bg-yellow  { background: #c4a000; }
.bg-blue    { background: #3465a4; }
.bg-magenta { background: #75507b; }
.bg-cyan    { background: #06989a; }
.bg-white   { background: #d3d7cf; }
.bg-bright-black   { background: #555753; }
.bg-bright-red     { background: #ef2929; }
.bg-bright-green   { background: #8ae234; }
.bg-bright-yellow  { background: #fce94f; }
.bg-bright-blue    { background: #729fcf; }
.bg-bright-magenta { background: #ad7fa8; }
.bg-bright-cyan    { background: #34e2e2; }
.bg-bright-white   { background: #eeeeec; }

.bold      { font-weight: bold; }
.italic    { font-style: italic; }
.underline { text-decoration: underline; }
.dim       { opacity: 0.6; }
.inverse   { filter: invert(1); }

/* ls color classes */
.ls-dir     { color: #729fcf; font-weight: bold; }
.ls-exec    { color: #8ae234; }
.ls-link    { color: #34e2e2; }
.ls-special { color: #fce94f; }
