.sp-workspace {
  --sp-ink: #183b50;
  --sp-blue: #136a8a;
}
.sp-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
  margin: 1.2rem 0;
}
.sp-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1 1 180px;
}
.sp-controls select,
.sp-controls input {
  max-width: 100%;
  min-height: 2.6rem;
}
.sp-controls button {
  min-height: 2.6rem;
}
.sp-note {
  padding: 1rem;
  border-left: 4px solid #cb8b19;
  background: #fff7e7;
  color: #493a23;
}
.sp-apparatus-wrap {
  overflow: auto;
  border: 1px solid #c6d8e1;
  border-radius: 12px;
  background: #f7fbfd;
  margin: 1rem 0;
}
.sp-apparatus-wrap svg {
  display: block;
  width: 100%;
  min-width: 640px;
  height: auto;
}
.sp-apparatus-wrap text {
  fill: var(--sp-ink);
  font:
    18px system-ui,
    sans-serif;
}
.sp-wire {
  stroke: #264b61;
  stroke-width: 4;
  fill: none;
  stroke-linecap: round;
}
.sp-lead-red {
  stroke: #b73537;
  stroke-width: 4;
  fill: none;
}
.sp-lead-black {
  stroke: #263a45;
  stroke-width: 4;
  fill: none;
}
.sp-resistor {
  fill: #f8eac9;
  stroke: #715f39;
  stroke-width: 3;
}
.sp-meter {
  fill: #e4eef1;
  stroke: #2e5c71;
  stroke-width: 3;
}
.sp-source {
  fill: #fff;
  stroke: #39576b;
  stroke-width: 3;
}
.sp-screen {
  fill: #d2e5c8;
  stroke: #5e7855;
  stroke-width: 2;
}
.sp-junction {
  fill: #25485d;
}
.sp-apparatus-wrap .sp-digits {
  font:
    22px ui-monospace,
    monospace;
}
.sp-readouts {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}
.sp-readouts p {
  background: #dcebcf;
  color: #162d17;
  border: 2px solid #526d4c;
  border-radius: 8px;
  padding: 0.8rem 1.2rem;
  font:
    1.25rem ui-monospace,
    monospace;
}
.sp-readouts output {
  font-weight: 700;
}
.sp-table-wrap {
  overflow-x: auto;
  margin: 1.2rem 0;
}
.sp-table-wrap table {
  width: 100%;
  border-collapse: collapse;
}
.sp-table-wrap th,
.sp-table-wrap td {
  text-align: left;
  padding: 0.7rem;
  border: 1px solid #ccdae1;
  vertical-align: middle;
}
.sp-table-wrap th {
  background: #edf4f8;
}
.sp-table-wrap input {
  width: 100%;
  min-width: 8rem;
  box-sizing: border-box;
}
.sp-accepted {
  background: #e2f3e5;
  color: #175a2b;
}
.sp-corrected {
  background: #fff1d6;
  color: #6d4505;
}
.sp-feedback {
  font-weight: 600;
}
.sp-graphs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 500px), 1fr));
  gap: 1rem;
}
.sp-graphs figure {
  margin: 0;
  min-width: 0;
  padding: 0.6rem;
  border: 1px solid #c9d8e1;
  border-radius: 8px;
  background: #fff;
}
.sp-graphs figcaption {
  font-weight: 700;
  color: var(--sp-ink);
  padding: 0.4rem;
}
.sp-graphs svg {
  width: 100%;
  height: auto;
}
.sp-graphs text {
  font:
    14px system-ui,
    sans-serif;
  fill: #24475b;
}
.sp-minor {
  stroke: #e2eaf0;
  stroke-width: 0.6;
}
.sp-major {
  stroke: #acbeca;
  stroke-width: 1;
}
.sp-series-0 {
  color: #075e9b;
}
.sp-series-1 {
  color: #aa3c10;
}
.sp-series-2 {
  color: #6b4097;
}
.sp-series-3 {
  color: #13703c;
}
.sp-fit {
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}
.sp-marker {
  stroke: currentColor;
  fill: currentColor;
  stroke-width: 1.5;
}
.sp-workspace input:focus-visible,
.sp-workspace select:focus-visible,
.sp-workspace button:focus-visible {
  outline: 3px solid #278fae;
  outline-offset: 3px;
}
.sp-workspace button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.sp-workspace form {
  margin: 1.4rem 0;
}
.sp-workspace label:has(input[type="range"]) {
  display: grid;
  gap: 0.4rem;
}
.sp-workspace input[type="range"] {
  width: min(100%, 650px);
}
@media (max-width: 600px) {
  .sp-controls {
    gap: 0.7rem;
  }
  .sp-readouts p {
    font-size: 1.05rem;
  }
  .sp-graphs {
    display: block;
  }
  .sp-graphs figure {
    margin-bottom: 1rem;
    overflow: auto;
  }
  .sp-graphs svg {
    min-width: 520px;
  }
  .sp-table-wrap th,
  .sp-table-wrap td {
    padding: 0.5rem;
  }
}

.sp-apparatus-wrap .sp-warning-digits {
  font:
    17px system-ui,
    sans-serif;
}

.sp-hardware { cursor: grab; touch-action: none; }
.sp-hardware:focus { outline: none; stroke: #165fba; stroke-width: 4; fill: #3a85c515; }
.sp-hardware[aria-disabled="true"] { cursor: not-allowed; stroke: #9caab3; }
