:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --bg: #050806; --bg-end: #0a0d0b; --radial: rgba(57,255,136,.08);
  --panel: #0b0f0d; --panel-end: #101613; --input: #050806; --text: #d8e6dd;
  --muted: #98a59e; --border: #26332d; --accent: #39ff88; --cyan: #22d3ee;
  --warning: #facc15; --error: #f87171; --log: #010302;
  --shadow: 0 0 0 1px rgba(57,255,136,.04), 0 18px 50px rgba(0,0,0,.35);
  --radius: 12px; --control-radius: 8px; --track: #030504;
}

[data-theme="light"] {
  color-scheme: light;
  --bg: #f5f5f7; --bg-end: #ececf0; --radial: rgba(0,113,227,.1);
  --panel: #fff; --panel-end: #fff; --input: #fbfbfd; --text: #1d1d1f;
  --muted: #6e6e73; --border: #d2d2d7; --accent: #0071e3; --cyan: #0066cc;
  --warning: #9a5a00; --error: #d70015; --log: #101418;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 14px 34px rgba(0,0,0,.08);
  --radius: 18px; --control-radius: 12px; --track: #e8e8ed;
}

* { box-sizing: border-box; }
body {
  min-height: 100vh; margin: 0; color: var(--text); line-height: 1.5;
  background: radial-gradient(circle at top left, var(--radial), transparent 34rem), linear-gradient(180deg, var(--bg), var(--bg-end));
}
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; opacity: .2; background: repeating-linear-gradient(180deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px); }
[data-theme="light"] body::before { display: none; }
.container { width: min(1180px, calc(100% - 32px)); margin: auto; padding: 24px 0 80px; }
.theme-toggle { position: fixed; z-index: 2; top: 18px; right: 18px; width: 42px; height: 42px; border-radius: 50%; padding: 0; }
.system-log, .panel { border: 1px solid var(--border); box-shadow: var(--shadow); }
.system-log { height: 240px; margin-bottom: 24px; border-radius: var(--radius); overflow: hidden; background: #0b0f0d; font-family: "SFMono-Regular", Consolas, monospace; }
.system-log-head { display: flex; align-items: center; gap: 9px; padding: 12px 16px; border-bottom: 1px solid #26332d; color: #39ff88; font-size: 12px; letter-spacing: .08em; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #39ff88; box-shadow: 0 0 9px #39ff88; }
.system-log-feed { height: calc(100% - 43px); overflow-y: auto; padding: 12px 16px; background: var(--log); color: #98a59e; font-size: 13px; line-height: 1.65; }
.log-line { white-space: pre-wrap; }
.log-success { color: #39ff88; } .log-active { color: #22d3ee; } .log-warning { color: #facc15; } .log-error { color: #f87171; }
.workspace-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 24px; }
.panel { padding: 22px; border-radius: var(--radius); background: linear-gradient(180deg, var(--panel), var(--panel-end)); }
label { display: block; margin-bottom: 9px; font-weight: 600; }
textarea { width: 100%; resize: vertical; padding: 14px; border: 1px solid var(--border); border-radius: var(--control-radius); outline: none; background: var(--input); color: var(--accent); font: 14px/1.5 "SFMono-Regular", Consolas, monospace; }
textarea::placeholder { color: var(--muted); }
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.divider { display: flex; align-items: center; gap: 14px; margin: 16px 0; color: var(--muted); }
.divider::before, .divider::after { content: ""; height: 1px; flex: 1; background: var(--border); }
.file-box { padding: 16px; border: 1px dashed var(--border); border-radius: var(--control-radius); background: var(--input); cursor: pointer; }
.file-box:hover { border-color: var(--accent); }
.file-box span, .file-box small { display: block; margin-top: 5px; color: var(--muted); font-weight: 400; }
.file-box input { margin-top: 12px; max-width: 100%; color: var(--text); }
.file-box small { font-size: 12px; }
button { margin-top: 18px; padding: 10px 14px; border: 1px solid var(--accent); border-radius: var(--control-radius); background: #07110c; color: var(--accent); font: inherit; font-weight: 700; cursor: pointer; transition: .18s ease; }
[data-theme="light"] button { background: var(--accent); color: #fff; }
button:hover { background: var(--accent); color: #001b0a; }
[data-theme="light"] button:hover { background: #0077ed; color: #fff; }
button:focus-visible, textarea:focus-visible, input:focus-visible { outline: 3px solid var(--cyan); outline-offset: 3px; }
.eyebrow { margin: 0 0 8px; color: var(--accent); font: 600 12px "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; }
h1 { margin: 0 0 18px; font-size: 24px; font-weight: 600; }
.progress-status { margin: 0 0 10px; font-size: 17px; }
.progress-count, .progress-current { margin: 0; color: var(--muted); }
.progress-percent { margin: 12px 0; color: var(--accent); font: 500 34px "SFMono-Regular", Consolas, monospace; }
.progress-track { height: 13px; margin-bottom: 12px; overflow: hidden; border: 1px solid var(--border); border-radius: 99px; background: var(--track); }
.progress-bar { width: 0; height: 100%; background: var(--accent); }
.progress-content.blocked .progress-status { color: var(--error); }

@media (max-width: 760px) {
  .container { width: min(100% - 24px, 1180px); padding-top: 72px; }
  .workspace-grid { grid-template-columns: 1fr; gap: 18px; }
  .system-log { height: 230px; }
  .panel { padding: 18px; }
}
