:root {
  --bg: #0f1115;
  --panel: #181c23;
  --panel-2: #20252e;
  --text: #e6e8ec;
  --muted: #9aa3b2;
  --accent: #4f8cff;
  --accent-hover: #6aa1ff;
  --border: #2a313c;
  --error: #ff6b6b;
  --ok: #5fd38d;
  --warn: #f1c45a;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

header {
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
}
header h1 { margin: 0; font-size: 1.5rem; }
header .subtitle { margin: 0.25rem 0 0; color: var(--muted); font-size: 0.95rem; }

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
  display: grid;
  gap: 2rem;
}

form { display: grid; gap: 1.5rem; }

fieldset {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem 1.25rem;
  background: var(--panel);
}
legend {
  padding: 0 0.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

label {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.9rem;
  font-size: 0.95rem;
}
label span em { color: var(--muted); font-style: normal; font-size: 0.85em; margin-left: 0.25rem; }

input[type="text"],
input[type="number"],
input[type="file"],
select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.55rem 0.7rem;
  font: inherit;
}
input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
}

button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 6px;
  padding: 0.75rem 1.25rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  justify-self: start;
}
button:hover { background: var(--accent-hover); }
button:disabled { background: var(--border); cursor: not-allowed; }

section#status {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem 1.25rem;
}
section#status h2 { margin-top: 0; font-size: 1.1rem; }
section#status code { background: var(--panel-2); padding: 0.1rem 0.4rem; border-radius: 4px; }

#run-state.running { color: var(--warn); }
#run-state.completed { color: var(--ok); }
#run-state.failed { color: var(--error); }

#error-box pre, #final-text {
  background: var(--panel-2);
  padding: 0.75rem;
  border-radius: 6px;
  overflow-x: auto;
  white-space: pre-wrap;
  font-size: 0.85rem;
  max-height: 14rem;
}

#result-summary { margin: 0.5rem 0 1rem; padding-left: 1.2rem; }
#result-summary li { margin: 0.15rem 0; }

a { color: var(--accent); }
a:hover { color: var(--accent-hover); }
