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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0d1117;
  color: #c9d1d9;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

h1 {
  font-size: 1.8rem;
  margin-bottom: .25rem;
}

.subtitle {
  color: #8b949e;
  margin-bottom: 1.5rem;
}

.subtitle a { color: #58a6ff; text-decoration: none; }
.subtitle a:hover { text-decoration: underline; }

/* Loading */
#loading {
  font-size: 1.1rem;
  color: #8b949e;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid #30363d;
  border-top-color: #58a6ff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Output area */
#output {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1rem;
  min-height: 120px;
  max-height: 50vh;
  overflow-y: auto;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: .9rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: 1rem;
}

#output .out-code {
  color: #8b949e;
}
#output .out-stdout {
  color: #c9d1d9;
}
#output .out-stderr {
  color: #f85149;
}

/* Input area */
.input-area {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  margin-bottom: .75rem;
}

.prompt {
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: .95rem;
  color: #58a6ff;
  padding-top: .6rem;
  user-select: none;
}

#code {
  flex: 1;
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 8px;
  color: #c9d1d9;
  font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
  font-size: .9rem;
  padding: .6rem .8rem;
  resize: vertical;
  outline: none;
  tab-size: 4;
}
#code:focus {
  border-color: #58a6ff;
}

/* Buttons */
.controls {
  display: flex;
  gap: .5rem;
}

button {
  background: #238636;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .5rem 1.2rem;
  font-size: .9rem;
  cursor: pointer;
  transition: background .15s;
}
button:hover { background: #2ea043; }
button:active { background: #1a7f37; }

#clear-btn {
  background: #30363d;
}
#clear-btn:hover { background: #484f58; }
