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

html, body {
  background-color: #0c0c0c;
  color: #cccccc;
  font-family: 'Cascadia Code', 'Consolas', 'JetBrains Mono', monospace;
  font-size: 13.5px;
  line-height: 1.45;
  height: 100%;
  width: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

.terminal-window {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: #0c0c0c;
  overflow: hidden;
}

/* Windows Terminal Titlebar */
.terminal-titlebar {
  height: 32px;
  background-color: #1f1f1f;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  border-bottom: 1px solid #141414;
  flex-shrink: 0;
}

.tab-list {
  display: flex;
  align-items: center;
  height: 100%;
  padding-left: 8px;
}

.terminal-tab {
  height: 32px;
  background-color: #0c0c0c;
  border-radius: 6px 6px 0 0;
  padding: 0 10px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: #ffffff;
  border-left: 1px solid #222222;
  border-right: 1px solid #222222;
  border-top: 1px solid #222222;
}

.tab-icon-svg {
  flex-shrink: 0;
}

.tab-title {
  font-size: 12px;
  color: #ffffff;
  white-space: nowrap;
}

.tab-close {
  font-size: 10px;
  color: #888888;
  margin-left: 8px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
}

.tab-close:hover {
  background: #333333;
  color: #ffffff;
}

.tab-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888888;
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
  margin-left: 2px;
}

.tab-action-btn:hover {
  background: #2a2a2a;
  color: #ffffff;
}

.window-controls {
  display: flex;
  height: 100%;
}

.win-btn {
  width: 44px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aaaaaa;
  font-size: 11px;
  cursor: pointer;
}

.win-btn:hover {
  background: #333333;
}

.win-close:hover {
  background: #e81123;
  color: #ffffff;
}

/* Terminal Canvas */
.terminal-app {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 32px);
  padding: 12px 18px 10px 18px;
  box-sizing: border-box;
  overflow: hidden;
  background-color: #0c0c0c;
  cursor: text;
}

/* Header */
.terminal-header {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
  margin-bottom: 14px;
  user-select: none;
}

.mascot-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.mascot-img {
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  display: block;
}

.header-details {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.header-line-1 {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.bold-brand {
  font-weight: 700;
  font-size: 13.5px;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.dim-version {
  font-size: 13px;
  color: #888888;
}

.header-line-2 {
  font-size: 13px;
  color: #888888;
}

.header-line-3 {
  font-size: 12.5px;
  color: #888888;
}

/* History / Commands Area */
.terminal-history {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 4px;
  margin-bottom: 8px;
}

.terminal-history::-webkit-scrollbar {
  width: 5px;
}

.terminal-history::-webkit-scrollbar-thumb {
  background: #252525;
  border-radius: 2px;
}

/* Command Highlight Bar (matching screenshot: #373737) */
.command-bar {
  background-color: #373737;
  color: #ffffff;
  padding: 3px 6px;
  font-size: 13.5px;
  width: 100%;
  border-radius: 1px;
  flex-shrink: 0;
  box-sizing: border-box;
}

.cmd-prompt {
  color: #888888;
}

.cmd-text {
  color: #ffffff;
}

.terminal-output-text {
  font-size: 13.5px;
  color: #cccccc;
  line-height: 1.5;
  padding: 2px 6px 8px 6px;
  word-break: break-word;
}

.terminal-output-text .thought-time {
  color: #737373;
  font-size: 12.5px;
  margin-bottom: 3px;
}

.code-cmd {
  color: #e5c07b;
  font-weight: 600;
}

.terminal-error-text {
  color: #e06c75;
  padding: 2px 6px 8px 6px;
}

/* Thinking Line (* Whirlpooling...) */
.thinking-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: #d77757;
  padding: 4px 6px;
  flex-shrink: 0;
}

.thinking-asterisk {
  font-weight: bold;
  animation: pulse-asterisk 1.2s infinite alternate;
}

/* Input Row bounded by two horizontal rules */
.input-container {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  margin-bottom: 8px;
}

.input-rule {
  height: 1px;
  background-color: #555555;
  width: 100%;
}

.input-row {
  display: flex;
  align-items: center;
  padding: 4px 0;
}

.prompt-symbol {
  color: #888888;
  font-size: 13.5px;
  user-select: none;
  padding-left: 2px;
}

.terminal-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-family: inherit;
  font-size: 13.5px;
  caret-color: #ffffff;
}

/* Footer Status Bar */
.terminal-footer {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
  font-size: 12px;
  user-select: none;
}

.footer-path {
  color: #737373;
}

.footer-status-line {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #737373;
}

.mode-tag {
  color: #d9a408;
  font-weight: 700;
}

.footer-dim {
  color: #737373;
}

.gpu-tag {
  color: #d9a408;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.gpu-tag.active {
  color: #98c379;
}

.gpu-tag.loading {
  color: #d77757;
}

.hidden {
  display: none !important;
}

@keyframes pulse-asterisk {
  0% { opacity: 0.5; transform: rotate(0deg); }
  100% { opacity: 1; transform: rotate(35deg); }
}
