/* VERSE Web — scientific dashboard styling.
 * Dark by default, light mode via [data-theme="light"] on <html>.
 * Monospace for numeric values, grid layout, data-dense.
 */

:root,
[data-theme="dark"] {
  --bg:        #0b0d10;
  --bg-panel:  #14181d;
  --bg-raise:  #1b2028;
  --border:    #2a323d;
  --text:      #e6ebf1;
  --text-dim:  #9aa4b2;
  --accent:    #5ab0ff;
  --accent-2:  #8affd6;
  --warn:      #f7b955;
  --error:     #ff7b7b;
  --ok:        #7ee787;
}

[data-theme="light"] {
  --bg:        #f6f7f9;
  --bg-panel:  #ffffff;
  --bg-raise:  #f0f3f6;
  --border:    #dde2e8;
  --text:      #0f1319;
  --text-dim:  #55606e;
  --accent:    #0969da;
  --accent-2:  #1a7f64;
  --warn:      #b88100;
  --error:     #cf222e;
  --ok:        #1a7f37;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.mono, code, pre, input[type=file], textarea, .pill {
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- top + bottom bars ---------- */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand-mark { font-size: 22px; }
.brand-name { color: var(--text); font-weight: 600; font-size: 16px; }
.brand-sub { color: var(--text-dim); font-size: 12px; }
.topnav { display: flex; gap: 16px; align-items: center; }
.topnav a { color: var(--text-dim); }
.topnav a:hover { color: var(--text); text-decoration: none; }
.theme-toggle {
  background: transparent; border: 1px solid var(--border); color: var(--text);
  border-radius: 4px; width: 28px; height: 28px; cursor: pointer;
}
.bottombar {
  margin-top: auto;
  padding: 10px 20px; color: var(--text-dim); font-size: 12px;
  border-top: 1px solid var(--border); background: var(--bg-panel);
}

/* ---------- layout ---------- */
.layout {
  max-width: 1400px; margin: 0 auto; padding: 20px; width: 100%;
  display: flex; flex-direction: column; gap: 20px; flex: 1;
}
.grid-two {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}
@media (max-width: 900px) {
  .grid-two { grid-template-columns: 1fr; }
}

/* ---------- panels ---------- */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 20px;
}
.panel-title {
  margin: 0 0 10px; font-size: 14px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-dim);
}
.muted { color: var(--text-dim); }
.small { font-size: 12px; }
.prose p { line-height: 1.65; }
.prose h2 { font-size: 15px; margin-top: 22px; }

/* ---------- form ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em; }
.form input[type=text], .form input[type=file], .form textarea {
  background: var(--bg-raise);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 8px 10px;
  font-size: 13px;
  width: 100%;
}
.form textarea { min-height: 180px; resize: vertical; }
.field-divider {
  text-align: center; color: var(--text-dim); font-size: 12px;
  position: relative; margin: 4px 0;
}
.field-divider::before, .field-divider::after {
  content: ""; position: absolute; top: 50%; width: 45%;
  border-top: 1px solid var(--border);
}
.field-divider::before { left: 0; }
.field-divider::after  { right: 0; }
.field-divider span { background: var(--bg-panel); padding: 0 8px; }

.btn {
  background: var(--bg-raise); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px; padding: 8px 14px; font-size: 13px;
  cursor: pointer; transition: background 0.1s;
}
.btn:hover { background: var(--border); }
.btn-primary {
  background: var(--accent); color: #fff; border-color: var(--accent);
  font-weight: 600;
}
.btn-primary:hover { filter: brightness(1.1); }

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

/* ---------- queue/stats ---------- */
.queue-stats { display: flex; gap: 14px; margin-bottom: 10px; }
.stat {
  background: var(--bg-raise); border: 1px solid var(--border);
  border-radius: 4px; padding: 10px 14px;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
}
.stat-num { font-size: 20px; font-weight: 600; }
.stat-label { font-size: 11px; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 0.05em; }

.job-list { list-style: none; padding: 0; margin: 8px 0 0; }
.job-list li + li { margin-top: 4px; }
.job-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border-radius: 4px; color: var(--text);
  background: var(--bg-raise); border: 1px solid var(--border);
}
.job-row:hover { background: var(--border); text-decoration: none; }
.job-name { font-family: inherit; }

/* ---------- pills / status ---------- */
.pill {
  display: inline-block; font-size: 11px; padding: 2px 8px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: 0.05em;
  border: 1px solid var(--border);
}
.pill-queued    { background: rgba(247,185,85,0.15);  color: var(--warn); border-color: var(--warn); }
.pill-running   { background: rgba(90,176,255,0.15);  color: var(--accent); border-color: var(--accent); }
.pill-done      { background: rgba(126,231,135,0.15); color: var(--ok);    border-color: var(--ok); }
.pill-failed,
.pill-timed_out { background: rgba(255,123,123,0.15); color: var(--error); border-color: var(--error); }
.pill-muted     { background: var(--bg-raise); color: var(--text-dim); }

/* ---------- job page ---------- */
.job-panel { max-width: 1200px; margin: 0 auto; width: 100%; }
.job-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 20px; margin-bottom: 10px;
}
.job-badges { display: flex; gap: 6px; }

.tabs {
  display: flex; gap: 2px; border-bottom: 1px solid var(--border);
  margin: 10px -20px 0; padding: 0 20px;
}
.tab {
  background: transparent; border: none; color: var(--text-dim);
  padding: 8px 12px; font-size: 13px; cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.tab-panel { padding-top: 18px; }
.plot { width: 100%; height: 440px; }

.logbox {
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 12px; font-size: 12px; overflow: auto; max-height: 520px;
  white-space: pre-wrap; word-break: break-word;
}

.profile-controls {
  padding: 6px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.pc-row-playback .pc-slider {
  flex: 1 1 300px;
  min-width: 200px;
  vertical-align: middle;
}
.pc-play {
  width: 36px;
  height: 32px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.pc-time {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
}
.pc-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-dim);
}
.pc-field input[type=number] {
  background: var(--bg-raise);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 6px;
  width: 64px;
  font-size: 12px;
  font-family: "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
}
.pc-field-label {
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.pc-field-loop input { margin: 0; }

.pc-view-toggle {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-raise);
}
.pc-view-opt {
  position: relative;
  padding: 6px 12px;
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  user-select: none;
  transition: background 0.1s, color 0.1s;
}
.pc-view-opt input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pc-view-opt:hover { color: var(--text); }
.pc-view-opt:has(input:checked) {
  background: var(--accent);
  color: #fff;
}

.file-list { list-style: none; padding: 0; margin: 0; }
.file-list li {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 4px; margin-bottom: 4px;
  background: var(--bg-raise);
}
