:root {
  color-scheme: dark;
  --bg: #0b0d12;
  --panel: #12151c;
  --panel-border: #232838;
  --text: #e6e9f2;
  --text-dim: #8891a7;
  --accent: #6ee7b7;
  --accent-dim: #2f6b52;
  --danger: #f87171;
  --warn: #fbbf24;
  --mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.shell {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 60px;
}

.topbar {
  padding: 28px 0 22px;
  border-bottom: 1px solid var(--panel-border);
  margin-bottom: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-mark { color: var(--accent); }

.brand-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-dim);
  font-family: var(--mono);
}

.grid {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 20px;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
  font-weight: 600;
}

.history-panel { grid-column: 1 / -1; }

form label {
  display: block;
  margin-bottom: 16px;
  font-size: 13px;
  color: var(--text-dim);
}

form label.row span { display: flex; justify-content: space-between; }
form label.row span b { color: var(--text); font-family: var(--mono); font-weight: 500; }

select, input[type="range"] {
  width: 100%;
  margin-top: 6px;
}

select {
  background: #0d1017;
  color: var(--text);
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  padding: 8px;
  font-family: var(--mono);
  font-size: 13px;
}

input[type="range"] {
  accent-color: var(--accent);
}

#run-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #06251a;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  margin-top: 4px;
}

#run-btn:disabled {
  background: #35405a;
  color: var(--text-dim);
  cursor: not-allowed;
}

#run-btn:hover:not(:disabled) { filter: brightness(1.08); }

.hint {
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.5;
  margin-top: 14px;
}

.hint code {
  background: #0d1017;
  padding: 1px 5px;
  border-radius: 4px;
  font-family: var(--mono);
}

.error {
  color: var(--danger);
  font-size: 13px;
  min-height: 1em;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.log-header h2 { margin: 0; }

.status {
  font-family: var(--mono);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.status-idle { background: #1c2130; color: var(--text-dim); }
.status-running { background: #2a2410; color: var(--warn); }
.status-completed { background: var(--accent-dim); color: var(--accent); }
.status-failed { background: #3a1c1c; color: var(--danger); }

#log-output {
  background: #05070a;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 16px;
  height: 480px;
  overflow-y: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  color: #c7ccd8;
  margin: 0;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-item {
  display: grid;
  grid-template-columns: 110px 1fr auto auto;
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  background: #0d1017;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  font-size: 13px;
}

.history-item .h-params {
  font-family: var(--mono);
  color: var(--text-dim);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-item .h-metric {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
}

.history-item a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--mono);
}
.history-item a:hover { text-decoration: underline; }

.empty-note {
  color: var(--text-dim);
  font-size: 13px;
  font-family: var(--mono);
}

@media (max-width: 860px) {
  .grid { grid-template-columns: 1fr; }
}
