:root {
  --bg: #0d0d12;
  --panel: #14141b;
  --fg: #e6e6ea;
  --dim: #808088;
  --cyan: #38c6dc;
  --magenta: #c98bff;
  --magenta-border: #7d4fa8;
  --red: #ff6b6b;
  --mono: "SFMono-Regular", "JetBrains Mono", "Fira Code", Menlo, Consolas,
    monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
}

.terminal {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ---- banner ---- */
.banner {
  padding: 20px 0 8px;
}
.banner-box {
  border: 1px solid var(--magenta-border);
  border-radius: 8px;
  padding: 16px 20px;
}
.banner-title {
  color: var(--magenta);
  font-weight: 700;
}
.banner-sub {
  color: var(--dim);
}
.hint {
  color: var(--dim);
  margin-top: 10px;
  padding-left: 4px;
}
.hint b {
  color: var(--fg);
  font-weight: 600;
}

/* ---- log ---- */
.log {
  flex: 1;
  overflow-y: auto;
  padding: 8px 2px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.turn-user {
  color: var(--cyan);
  white-space: pre-wrap;
  word-break: break-word;
}
.turn-user .caret {
  font-weight: 700;
}

/* assistant panel — mirrors the rich "Evtim" bordered panel */
.panel {
  border: 1px solid var(--magenta-border);
  border-radius: 8px;
  position: relative;
  padding: 16px 20px;
}
.panel-title {
  position: absolute;
  top: -0.72em;
  left: 14px;
  background: var(--bg);
  padding: 0 6px;
  color: var(--magenta);
  font-weight: 700;
}
.panel-stats {
  position: absolute;
  bottom: -0.72em;
  right: 14px;
  background: var(--bg);
  padding: 0 6px;
  color: var(--dim);
  font-size: 12px;
}
.panel.error {
  border-color: var(--red);
}
.panel.error .panel-title {
  color: var(--red);
}

/* thinking spinner */
.thinking {
  color: var(--dim);
}
.dots::after {
  content: "";
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: "·";
  }
  50% {
    content: "··";
  }
  75% {
    content: "···";
  }
}

/* system / rule lines */
.rule {
  color: var(--dim);
  text-align: center;
  border-top: 1px dashed #333;
  line-height: 0.1em;
  margin: 6px 0;
}
.rule span {
  background: var(--bg);
  padding: 0 10px;
}
.system {
  color: var(--dim);
}

/* markdown inside panels */
.md > *:first-child {
  margin-top: 0;
}
.md > *:last-child {
  margin-bottom: 0;
}
.md h1,
.md h2,
.md h3 {
  color: var(--magenta);
  margin: 0.6em 0 0.3em;
}
.md code {
  background: #000;
  border-radius: 4px;
  padding: 1px 5px;
  color: #9cdcfe;
}
.md pre {
  background: #000;
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
}
.md pre code {
  padding: 0;
}
.md a {
  color: var(--cyan);
}
.md ul,
.md ol {
  padding-left: 22px;
  margin: 0.4em 0;
}

/* ---- composer ---- */
.composer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-top: 1px solid #22222c;
}
.prompt-caret {
  color: var(--cyan);
  font-weight: 700;
  white-space: nowrap;
  padding-top: 4px;
}
.input-wrap {
  position: relative;
  flex: 1;
}
.input {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: var(--fg);
  font-family: var(--mono);
  font-size: 14px;
  line-height: 1.5;
  padding: 4px 0;
  margin: 0;
  resize: none;
  overflow-y: auto;
  max-height: 40vh;
  white-space: pre-wrap;
  word-break: break-word;
}
.input::placeholder {
  color: #55555e;
  font-style: italic;
}

/* autocomplete */
.complete {
  position: absolute;
  bottom: 130%;
  left: 0;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--panel);
  border: 1px solid var(--magenta-border);
  border-radius: 6px;
  min-width: 320px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
}
.complete li {
  padding: 5px 8px;
  border-radius: 4px;
  display: flex;
  gap: 12px;
  cursor: pointer;
}
.complete li .cmd {
  color: var(--cyan);
  font-weight: 600;
  min-width: 72px;
}
.complete li .desc {
  color: var(--dim);
}
.complete li.active,
.complete li:hover {
  background: #24243040;
}
.complete li.active {
  background: #2a2a38;
}

/* ---- status bar ---- */
.statusbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 12px;
  background: #1a1a22;
  border-radius: 6px;
  color: var(--dim);
  font-size: 12px;
}
.statusbar b {
  color: #c9c9d2;
  font-weight: 600;
}
.sb-spacer {
  flex: 1;
}
.sb-sep {
  color: #3a3a44;
}
.sb-dim {
  color: #55555e;
}
