* { box-sizing: border-box; margin: 0; padding: 0; }
body { background: #0d1117; color: #c9d1d9; font-family: 'Segoe UI', monospace; }

#app { max-width: 1200px; margin: 0 auto; padding: 16px; }

header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; border-bottom: 1px solid #30363d; margin-bottom: 16px;
}
h1 { font-size: 1.3rem; }

#status-bar { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: #8b949e; }
#status-dot { color: #f85149; }
#status-dot.ok { color: #3fb950; }

#auth-section { display: flex; gap: 8px; margin-bottom: 16px; }
#token-input {
  flex: 1; padding: 8px 12px; background: #161b22; border: 1px solid #30363d;
  color: #c9d1d9; border-radius: 6px; font-family: monospace;
}
button {
  padding: 8px 16px; background: #238636; color: #fff; border: none;
  border-radius: 6px; cursor: pointer; font-size: 0.9rem;
}
button:hover { background: #2ea043; }
button:disabled { background: #30363d; cursor: not-allowed; }

#tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.tab { background: #161b22; border: 1px solid #30363d; color: #8b949e; }
.tab.active { background: #238636; color: #fff; border-color: #238636; }

.tab-content { display: none; }
.tab-content.active { display: block; }

#mode-select {
  display: flex; align-items: center; gap: 16px; padding: 8px;
  background: #161b22; border: 1px solid #30363d; border-radius: 6px 6px 0 0;
  font-size: 0.85rem;
}
#mode-select label { display: flex; align-items: center; gap: 4px; cursor: pointer; }
#timeout-input {
  width: 60px; padding: 2px 6px; background: #0d1117; border: 1px solid #30363d;
  color: #c9d1d9; border-radius: 4px; text-align: center;
}

#terminal-container {
  background: #000; padding: 8px; min-height: 300px;
  border: 1px solid #30363d; border-top: none; border-bottom: none;
}

#input-row { display: flex; gap: 8px; }
#cmd-input {
  flex: 1; padding: 8px; background: #161b22; border: 1px solid #30363d;
  color: #c9d1d9; border-radius: 0 0 0 6px; font-family: monospace; font-size: 0.9rem; resize: vertical;
}
#run-btn { border-radius: 0 0 6px 0; min-width: 80px; background: #1f6feb; }
#run-btn:hover { background: #388bfd; }

#history-controls { display: flex; gap: 8px; margin-bottom: 12px; }
#refresh-history, #clear-history { background: #21262d; border: 1px solid #30363d; color: #c9d1d9; }

.history-item {
  border: 1px solid #30363d; border-radius: 6px; margin-bottom: 8px;
  overflow: hidden; font-size: 0.85rem;
}
.history-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 12px; background: #161b22; cursor: pointer;
}
.history-header:hover { background: #1c2128; }
.exit-ok { color: #3fb950; }
.exit-err { color: #f85149; }
.history-body { padding: 12px; background: #0d1117; display: none; }
.history-body.open { display: block; }
.history-body pre { white-space: pre-wrap; word-break: break-all; font-size: 0.8rem; }
.history-stderr { color: #f85149; margin-top: 8px; }

#file-controls { display: flex; gap: 8px; margin-bottom: 8px; }
#file-path {
  flex: 1; padding: 8px; background: #161b22; border: 1px solid #30363d;
  color: #c9d1d9; border-radius: 6px; font-family: monospace;
}
#file-content {
  width: 100%; padding: 8px; background: #161b22; border: 1px solid #30363d;
  color: #c9d1d9; border-radius: 6px; font-family: monospace; font-size: 0.85rem; resize: vertical;
}
#file-write-btn { margin-top: 8px; background: #9e6a03; }
#file-write-btn:hover { background: #bb8009; }
