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

:root {
  --bg:          #0d1117;
  --text:        #c9d1d9;
  --prompt:      #58a6ff;
  --muted:       #8b949e;
  --success:     #56d364;
  --highlight:   #e3b341;
  --accent:      #f778ba;
  --dot-red:     #ff5f57;
  --dot-yellow:  #febc2e;
  --dot-green:   #28c840;
  --bar-bg:      #161b22;
  --border:      #30363d;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px;
}

#terminal-wrap {
  width: 100%;
  max-width: 880px;
}

#terminal {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7);
}

/* ── Title bar ── */

#titlebar {
  background: var(--bar-bg);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.dots {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-shrink: 0;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: block;
}

.dot-red    { background: var(--dot-red); }
.dot-yellow { background: var(--dot-yellow); }
.dot-green  { background: var(--dot-green); }

#titlebar-text {
  flex: 1;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

/* ── Terminal body ── */

#terminal-body {
  background: var(--bg);
  padding: 24px;
  min-height: 540px;
  cursor: text;
}

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

.ln {
  display: block;
  min-height: 1.7em;
}

/* ── Input line ── */

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

.prompt-sym {
  color: var(--prompt);
  user-select: none;
  flex-shrink: 0;
}

#display-text {
  color: var(--text);
  white-space: pre;
}

#cursor {
  color: var(--prompt);
  animation: blink 1s step-end infinite;
  user-select: none;
}

#cmd-input {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: text;
  font-family: inherit;
  font-size: inherit;
  border: none;
  background: transparent;
  color: transparent;
}

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

/* ── Skill tags ── */

.tag {
  display: inline-block;
  color: var(--highlight);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 8px;
  margin: 2px 5px 2px 0;
  font-size: 13px;
  line-height: 1.6;
}

/* ── Links ── */

a {
  color: var(--prompt);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Inline shortcut buttons ── */

.sc-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0;
}

.sc {
  background: transparent;
  border: 1px solid #30363d;
  color: #8b949e;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  padding: 2px 10px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.12s, color 0.12s;
  outline: none;
  box-shadow: none;
}

.sc:hover {
  border-color: #58a6ff;
  color: #58a6ff;
}

.sc.sc-active {
  border-color: #58a6ff;
  color: #58a6ff;
}

.sc-ask:hover,
.sc-ask.sc-active {
  border-color: #f778ba;
  color: #f778ba;
}

.sc:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Scrollbar ── */

::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Mobile ── */

@media (max-width: 600px) {
  body {
    padding: 0;
    align-items: stretch;
    height: 100svh;
    overflow: hidden;
  }

  #terminal-wrap {
    max-width: 100%;
    height: 100svh;
    display: flex;
    flex-direction: column;
  }

  #terminal {
    flex: 1;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
  }

  #terminal-body {
    flex: 1;
    padding: 16px 14px;
    font-size: 13px;
    overflow-y: auto;
    min-height: 0;
  }

  #cmd-input {
    font-size: 13px;
  }
}
