:root {
  color-scheme: light;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d7dee8;
  --panel: #ffffff;
  --soft: #f6f8fb;
  --source: #d73027;
  --target: #2166ac;
  --plan: #7b3294;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: transparent;
  color: var(--ink);
  font: 14px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ot4ml-panel {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-left: 3px solid #3f6f8f;
  border-radius: 8px;
  background: var(--panel);
  padding: 12px;
}

.ot4ml-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 9px 12px;
  align-items: end;
  margin-bottom: 10px;
}

.ot4ml-control {
  display: grid;
  min-width: 0;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ot4ml-readout {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.ot4ml-slider-row {
  display: grid;
  grid-template-columns: minmax(48px, 1fr) 64px;
  gap: 6px;
  align-items: center;
}

input[type="range"] {
  width: 100%;
  accent-color: #3f6f8f;
}

input[type="number"],
select {
  width: 100%;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 3px 8px;
  font: inherit;
}

input[type="number"] {
  font-variant-numeric: tabular-nums;
  padding-right: 4px;
}

canvas {
  width: 100%;
  height: 360px;
  display: block;
  border-radius: 6px;
  background: linear-gradient(#fff, #fbfcfd);
}

.ot4ml-status {
  min-height: 18px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ot4ml-error {
  border-color: #e7b6ad;
  border-left-color: #b42318;
  color: #7a271a;
}

@media (max-width: 560px) {
  .ot4ml-panel {
    padding: 10px;
  }

  canvas {
    height: 320px;
  }

  .ot4ml-controls {
    grid-template-columns: repeat(auto-fit, minmax(98px, 1fr));
  }

  .ot4ml-slider-row {
    grid-template-columns: 1fr;
  }
}
