:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #dce7f5;
  background: #09101c;
  --panel: #101a2a;
  --panel-2: #151f31;
  --line: #25334a;
  --muted: #8292aa;
  --accent: #4f8cff;
  --good: #35c58a;
  --bad: #ff6b78;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 940px; height: 100vh; overflow: hidden; }
button, input, select { font: inherit; }
button {
  border: 1px solid #4f8cff; background: #3b76e4; color: white;
  border-radius: 7px; padding: 8px 12px; cursor: pointer;
}
button:hover { filter: brightness(1.12); }
button:disabled, input:disabled, select:disabled { opacity: .38; cursor: not-allowed; }
button.ghost { background: transparent; border-color: var(--line); color: #cbd8ea; }
button.small { padding: 6px 9px; font-size: 12px; }
.toolbar {
  height: 54px; display: flex; align-items: center; gap: 22px; padding: 0 15px;
  border-bottom: 1px solid var(--line); background: #0d1625;
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 215px; }
.brand-mark {
  display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px;
  background: linear-gradient(135deg, #77a8ff, #7b5cff); font-weight: 800;
}
.brand small, .hint, .curve-source { color: var(--muted); }
.job-strip { flex: 1; display: flex; align-items: center; gap: 10px; max-width: 650px; }
.status { min-width: 130px; font-size: 13px; }
.status.running, .status.queued { color: #8fb3ff; }
.status.completed { color: var(--good); }
.status.failed, .status.cancelled { color: var(--bad); }
progress { width: min(300px, 30vw); height: 7px; accent-color: var(--accent); }
.toolbar-actions { margin-left: auto; display: flex; gap: 8px; }
.workspace {
  height: calc(100vh - 54px); display: grid;
  grid-template-columns: 300px minmax(520px, 1fr) 275px;
}
.panel { background: var(--panel); overflow-y: auto; padding: 14px; }
.left-panel { border-right: 1px solid var(--line); }
.right-panel { border-left: 1px solid var(--line); }
section { margin-bottom: 17px; }
h1, h2, p { margin-top: 0; }
h1 { font-size: 17px; margin-bottom: 5px; }
h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: #93a5be; margin-bottom: 10px; }
label { display: grid; gap: 5px; font-size: 12px; color: #aab8ca; margin-bottom: 9px; }
input, select {
  width: 100%; min-width: 0; color: #e6eef9; background: #0b1422;
  border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; outline: none;
}
input:focus, select:focus { border-color: var(--accent); }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.field-grid.three { grid-template-columns: 1fr 1fr 76px; }
.fixed-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.axis-choice {
  padding: 11px; margin-inline: -4px; border: 1px solid #2c4160;
  border-radius: 9px; background: #121f32;
}
.result-label { margin-bottom: 5px; }
.result-groups {
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 6px;
}
.result-group {
  min-height: 34px; padding: 5px 6px; border-color: var(--line);
  background: #0b1422; color: #9fb0c6; font-size: 11px;
}
.result-group.active { border-color: var(--accent); background: #1b3154; color: #fff; }
.field-hint { margin: -2px 0 7px; color: var(--muted); font-size: 11px; }
details { border-top: 1px solid var(--line); padding-top: 10px; margin-bottom: 13px; }
summary { color: #aab8ca; font-size: 12px; cursor: pointer; margin-bottom: 10px; }
.value-list { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 8px; }
.value-row { display: flex; gap: 4px; }
.value-row button { padding: 5px 8px; }
.run { width: 100%; padding: 10px; font-weight: 700; position: sticky; bottom: 0; }
.error { color: var(--bad); font-size: 12px; margin: 8px 0 0; min-height: 15px; white-space: pre-wrap; }
.center { min-width: 0; background: #0a121f; display: flex; flex-direction: column; margin: 0; }
.tabs {
  height: 42px; display: flex; align-items: end; gap: 3px; padding: 7px 10px 0;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.add-tab {
  align-self: end; flex: 0 0 auto; width: 34px; height: 32px; padding: 0 0 2px;
  margin-left: 3px; margin-bottom: -1px; border-color: var(--line);
  border-radius: 7px 7px 0 0; background: #101b2c; color: #a9c5ee;
  font-size: 20px; line-height: 1;
}
.add-tab:hover { border-color: var(--accent); background: #1a3154; color: #fff; filter: none; }
.tab { border-color: transparent; border-bottom-left-radius: 0; border-bottom-right-radius: 0; padding: 7px 13px; white-space: nowrap; }
.tab-wrap { display: flex; align-items: stretch; border: 1px solid transparent; border-bottom: 0; border-radius: 7px 7px 0 0; }
.tab-wrap.active { background: var(--panel-2); border-color: var(--line); }
.tab-wrap .tab { border: 0; border-radius: 6px 0 0 0; }
.tab-wrap.active .tab { background: transparent; }
.close-tab {
  padding: 4px 9px; border: 0; border-radius: 0 6px 0 0;
  background: transparent; color: var(--muted); font-size: 16px;
}
.close-tab:hover, .danger-icon:hover { color: #fff; background: #8f2c3a; filter: none; }
.chart-card {
  position: relative; flex: 1; min-height: 0; margin: 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); overflow: hidden;
}
.chart-head { height: 57px; display: flex; align-items: center; padding: 10px 14px 6px; }
.chart-head p { color: var(--muted); font-size: 12px; margin-bottom: 0; }
.axis-bar {
  position: relative; height: 42px; display: flex; align-items: center; gap: 10px;
  padding: 5px 12px; border-block: 1px solid var(--line); background: #101a29;
}
.axis-pair { flex: 1; min-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #aebed2; font-size: 12px; }
.compact { display: flex; align-items: center; gap: 5px; margin: 0; }
.compact select { width: 76px; padding: 4px 6px; }
.check { display: flex; align-items: center; gap: 5px; margin: 0; white-space: nowrap; }
.check input { width: auto; }
.range-popover { position: relative; border: 0; padding: 0; margin: 0; }
.range-popover summary { margin: 0; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; list-style: none; }
.range-popover[open] .range-grid {
  position: absolute; z-index: 5; top: 34px; right: 0; width: 245px; padding: 10px;
  background: #101a2a; border: 1px solid #344764; border-radius: 8px; box-shadow: 0 10px 30px #030712aa;
}
.range-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
.range-limit.muted { opacity: .4; }
.plot { height: calc(100% - 99px); }
.empty {
  position: absolute; inset: 99px 0 0; display: grid; place-content: center;
  text-align: center; gap: 8px; color: var(--muted); pointer-events: none;
}
.empty strong { color: #c7d6e9; }
.curve-source {
  min-height: 42px; padding: 8px; border: 1px solid var(--line);
  border-radius: 7px; font-size: 12px; line-height: 1.45;
}
.curve-picker { display: grid; grid-template-columns: minmax(0, 1fr) 34px; gap: 7px; align-items: end; }
.curve-picker label { margin: 0; }
.danger-icon {
  height: 34px; padding: 0; border-color: #54323c; background: transparent;
  color: #de8793; font-size: 18px;
}
.hint { font-size: 12px; line-height: 1.5; }
dialog {
  width: min(1180px, 94vw); height: min(820px, 92vh); padding: 0;
  border: 1px solid #344764; border-radius: 12px; color: #dce7f5; background: #111b2b;
}
dialog::backdrop { background: rgba(2, 7, 14, .78); backdrop-filter: blur(3px); }
.modal-head { height: 65px; display: flex; justify-content: space-between; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 14px; color: #e3ebf7; text-transform: none; letter-spacing: 0; margin-bottom: 4px; }
.modal-head p { color: var(--muted); font-size: 12px; }
#contour-plot { height: calc(100% - 65px); }
@media (max-width: 1200px) {
  .workspace { grid-template-columns: 265px minmax(440px, 1fr) 245px; }
  .brand { min-width: 175px; }
  .axis-bar { gap: 6px; }
  .axis-pair { display: none; }
}
