:root {
  --bg: #0f1116;
  --panel: #1a1d26;
  --panel-2: #232733;
  --text: #e6e8ee;
  --muted: #99a0b0;
  --accent: #4da3ff;
  --border: #2c313f;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
}
header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
}
header h1 { margin: 0; font-size: 18px; }
.subtitle { color: var(--muted); font-size: 13px; margin-top: 2px; }
.status { color: var(--muted); font-size: 12px; margin-top: 4px; }

main {
  display: flex;
  gap: 12px;
  padding: 12px;
  height: calc(100vh - 74px);
}
.plots {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.plot {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 0;
}
.sidebar {
  width: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
}
.panel h2 { margin: 0 0 8px; font-size: 14px; }
.hint { color: var(--muted); font-size: 12px; margin: 0 0 8px; }

.range-row { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; }
.range-row label { display: flex; flex-direction: column; font-size: 12px; color: var(--muted); gap: 2px; }
input[type="number"] { width: 80px; padding: 4px 6px; background: var(--panel-2); border: 1px solid var(--border); color: var(--text); border-radius: 4px; }

button {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 5px 10px;
  cursor: pointer;
  font-size: 13px;
}
button:hover { border-color: var(--accent); }
.btn-row { display: flex; gap: 6px; margin-bottom: 8px; }

.curve-list { display: flex; flex-direction: column; gap: 3px; max-height: 240px; overflow-y: auto; }
.curve-item { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 4px; border-radius: 4px; }
.curve-item:hover { background: var(--panel-2); }
.curve-item input { accent-color: var(--accent); }
.swatch { width: 22px; height: 3px; border-radius: 2px; display: inline-block; }
.swatch.dash { background-image: repeating-linear-gradient(90deg, currentColor 0 4px, transparent 4px 7px); height: 0; border-top: 3px dashed currentColor; }

.upload-msg { font-size: 12px; margin-top: 8px; color: var(--muted); white-space: pre-wrap; }
#file { font-size: 12px; margin-bottom: 8px; width: 100%; }
