:root {
  --bg: #1c1008; --surface: #2a1810; --surface2: #3f2a1a; --surface3: #4a311c;
  --border: #92400e; --text: #ffedd5; --muted: #fdba74; --accent: #f97316;
  --accent2: #c2410c; --accent_text: #1c1008; --success: #65a30d; --warning: #f59e0b;
  --error: #ef4444; --pending: #a16207; --running: #f97316; --header: #140c08;
}
* { box-sizing: border-box; }
body {
  margin: 0; font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
}
#topbar {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--header); padding: 12px 20px; border-bottom: 1px solid var(--border);
}
.brand { font-weight: 700; font-size: 1.2em; color: var(--accent); }
.controls { display: flex; gap: 18px; align-items: center; }
.controls label { display: flex; flex-direction: column; font-size: 0.75em; color: var(--muted); gap: 2px; }
select, input[type=range] { background: var(--surface2); color: var(--text); border: 1px solid var(--border); border-radius: 4px; padding: 4px; }

#crumbs { display: flex; align-items: center; gap: 6px; padding: 14px 20px; overflow-x: auto; }
.crumb {
  padding: 10px 16px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); white-space: nowrap; font-size: 0.85em;
}
.crumb.success { background: var(--success); color: var(--accent_text); }
.crumb.error { background: var(--error); color: #fff; }
.crumb.running { background: var(--running); color: var(--accent_text); }
.crumb.pending { color: var(--muted); }
.crumb-arrow { color: var(--muted); }

main { display: flex; gap: 20px; padding: 0 20px 20px; }
#runPanel { flex: 2; min-width: 0; }
.run-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; flex-wrap: wrap; }
button {
  background: var(--accent); color: var(--accent_text); border: none; border-radius: 6px;
  padding: 8px 14px; cursor: pointer; font-weight: 600;
}
button:hover { background: var(--accent2); }
#statusLine { color: var(--muted); font-size: 0.85em; margin-left: auto; }

#log { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px; height: 60vh; overflow-y: auto; }
.bubble { border-radius: 8px; padding: 8px 12px; margin-bottom: 6px; font-family: monospace; font-size: 0.85em; }
.bubble.INFO { background: var(--surface2); }
.bubble.CALL { background: var(--surface3); }
.bubble.OUTPUT { background: var(--success); color: var(--accent_text); }
.bubble.ERROR { background: var(--error); color: #fff; }
.bubble .seq { color: var(--muted); margin-right: 8px; }

#filesPanel { flex: 1; display: flex; gap: 12px; min-width: 320px; }
.file-col { flex: 1; min-width: 0; }
.file-list { list-style: none; margin: 0; padding: 0; max-height: 30vh; overflow-y: auto; border: 1px solid var(--border); border-radius: 6px; }
.file-list li { padding: 6px 8px; cursor: pointer; border-bottom: 1px solid var(--border); font-size: 0.85em; }
.file-list li:hover { background: var(--surface2); }
.preview-col { flex: 1.4; }
#filePreview { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 8px; height: 30vh; overflow: auto; white-space: pre-wrap; font-size: 0.8em; }
#fileMeta { color: var(--muted); font-size: 0.75em; margin: 4px 0; }
