:root {
  --term-bg: #0c0f0a;
  --term-fg: #d6f5d6;
  --term-dim: #6b8f6b;
  --term-accent: #50fa7b;
  --term-cursor: #50fa7b;
  --term-font: "Cascadia Code", "Fira Code", "JetBrains Mono", Consolas, "Courier New", monospace;
}

.terminal * { box-sizing: border-box; }

.terminal {
  height: 100%;               /* was 100vh — now fills .content-inner-chat */
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  background: var(--term-bg);
  color: var(--term-fg);
  font-family: var(--term-font);
}

.term-output {
  flex: 1 1 auto;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.45;
  font-size: 14px;
  padding-bottom: 8px;
}

.term-line {
  margin: 0;
}

.term-line .dim {
  color: var(--term-dim);
}

.term-inputline {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  border-top: 1px solid #1c261c;
  padding-top: 8px;
  font-size: 14px;
}

.term-prompt {
  color: var(--term-accent);
  white-space: pre;
  margin-right: 6px;
  flex-shrink: 0;
}

/* main.css styles every bare <input type="text"> (for plain Django form
   fields elsewhere in the app) with a boxed, bordered look — and since
   `input[type="text"]` is more specific than a plain class selector, it wins
   over `.term-input` regardless of load order. Scope to `.term-inputline` so
   this rule outranks it and actually resets what it leaks in. */
.term-inputline .term-input {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  outline: none;
  box-shadow: none;
  color: var(--term-fg);
  font: inherit;
  caret-color: var(--term-cursor);
}

.term-inputline .term-input:focus {
  background: transparent;
  border: none;
  outline: none;
  box-shadow: none;
  color: var(--term-fg);
}

.term-output::-webkit-scrollbar {
  width: 10px;
}
.term-output::-webkit-scrollbar-track {
  background: var(--term-bg);
}
.term-output::-webkit-scrollbar-thumb {
  background: #1c261c;
  border-radius: 6px;
}

@media (max-width: 767.98px) {
  .terminal {
    padding: 10px 12px;
  }

  .term-output {
    font-size: 15px;
  }

  .term-inputline {
    min-height: 46px; /* comfortable tap target, matches the rest of the app's inputs */
  }

  .term-inputline,
  .term-inputline .term-input {
    /* iOS Safari zooms the whole page in when a focused input's computed
       font-size is under 16px — 14px (inherited via `font: inherit`) was
       triggering that on every tap. */
    font-size: 16px;
  }
}