.scope {
  --scope-ivory: #f2f5f7;
  --scope-ink: #222b32;
  --scope-sage: #1a8f50;
  --scope-orange: #24a9e0;
  --scope-screen: #151c23;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 280px;
  overflow: auto;
  padding: 0 14px 12px;
  color: var(--scope-ink);
  background: var(--scope-ivory);
  border-top: 1px solid #222b3224;
  font-family: "Inter", "Alexandria", "Segoe UI", Tahoma, sans-serif;
  font-size: 12px;
  line-height: 1.4;
  isolation: isolate;
  container-type: inline-size;
  container-name: scope;
}

.scope *,
.scope *::before,
.scope *::after {
  box-sizing: border-box;
}
.scope button,
.scope input {
  font: inherit;
}
.scope button {
  cursor: pointer;
}
.scope button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.scope button:focus-visible,
.scope input:focus-visible,
.scope [tabindex]:focus-visible {
  outline: 2px solid var(--scope-orange);
  outline-offset: 3px;
}
.scope button svg {
  flex-shrink: 0;
  pointer-events: none;
}

.scope-header,
.scope-heading,
.scope-controls,
.scope-button-group {
  display: flex;
  align-items: center;
}
.scope-header {
  min-height: 47px;
  flex-shrink: 0;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
}
.scope-heading {
  gap: 9px;
  min-width: 0;
}
.scope-mark {
  display: grid;
  place-items: center;
  color: var(--scope-sage);
}
.scope-heading h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: -0.35px;
}
.scope-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-inline-start: 5px;
  color: #586269;
  font-size: 10px;
  white-space: nowrap;
}
.scope-status > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--scope-sage);
}
.scope-status--stale {
  color: #8f6400;
}
.scope-status--stale > span {
  background: var(--scope-orange);
}
.scope-controls {
  gap: 9px;
}
.scope-button-group {
  gap: 2px;
}
.scope-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 29px;
  min-width: 29px;
  padding: 0 7px;
  border: 1px solid transparent;
  border-radius: 5px;
  color: var(--scope-ink);
  background: transparent;
  font-size: 11px;
  font-weight: 550;
}
.scope-controls button:hover:not(:disabled) {
  background: #222b320a;
  border-color: #222b321f;
}
.scope-control-divider {
  width: 1px;
  height: 14px;
  background: #222b3224;
  margin: 0 4px;
}
.scope-controls .scope-export {
  padding: 0 11px;
  border-color: #222b322b;
  background: #fff9;
}
.scope-controls .scope-export:hover:not(:disabled) {
  background: #e4e9ec;
  border-color: var(--scope-sage);
}

.scope-instrument {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 237px;
  overflow: hidden;
  color: #d9dee2;
  background: var(--scope-screen);
  border: 1px solid #0d1217;
  border-radius: 9px;
  box-shadow:
    inset 0 1px 0 #ffffff0a,
    0 2px 4px #151c230a;
}
.scope-channel-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 33px;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid #d4dce212;
}
.scope-channels {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: thin;
  scrollbar-color: #424e56 transparent;
  padding: 3px 1px;
}
.scope-channel {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 24px;
  max-width: 210px;
  padding: 2px 7px;
  color: #e0e5e8;
  background: #d3dde408;
  border: 1px solid #d3dde419;
  border-radius: 4px;
  font-size: 10px;
  transition:
    background 120ms,
    border-color 120ms;
}
.scope-channel:hover {
  background: #d3dde416;
  border-color: #d3dde444;
}
.scope-channel[aria-pressed="false"] {
  color: #939ca2;
  background: transparent;
  border-color: transparent;
}
.scope-channel[aria-pressed="false"] .scope-channel-name {
  text-decoration: line-through;
}
.scope-channel[aria-pressed="false"] .scope-channel-dot {
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--channel-color, #84c3e0);
}
.scope-channel-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--channel-color, #84c3e0);
}
.scope-channel-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scope-channel-number,
.scope-channel-unit {
  color: #9ba4ab;
  font-size: 9px;
}
.scope-channel-unit {
  margin-inline-start: 4px;
}
.scope-capture-info,
.scope-no-probes {
  color: #9da6ac;
  font-size: 9px;
  white-space: nowrap;
  letter-spacing: 0.2px;
}
.scope-no-probes {
  letter-spacing: 1px;
}
.scope-capture-info {
  flex-shrink: 0;
}
.scope-capture-info > span {
  margin: 0 4px;
  color: #6c7880;
}
.scope-capture-info .scope-gesture-hint {
  margin: 0 18px 0 0;
  color: #9da6ac;
}

.scope-display {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  grid-template-rows: minmax(0, 1fr);
  flex: 1;
  min-height: 114px;
}
.scope-plot {
  position: relative;
  min-width: 0;
  min-height: 114px;
  overflow: hidden;
  background: radial-gradient(ellipse at 48% 45%, #222e3a24, transparent 75%);
}
.scope-svg {
  position: absolute;
  inset: 0;
  display: block;
  overflow: hidden;
  touch-action: pan-y;
  user-select: none;
}
.scope-svg:focus-visible {
  outline-offset: -3px !important;
}
.scope-grid-minor {
  stroke: #bfc8cf;
  stroke-opacity: 0.045;
  stroke-width: 0.6;
}
.scope-grid-major {
  stroke: #bfc8cf;
  stroke-opacity: 0.12;
  stroke-width: 0.7;
}
.scope-grid-zero {
  stroke: #bfc8cf;
  stroke-opacity: 0.28;
  stroke-width: 0.8;
  stroke-dasharray: 3 4;
}
.scope-axis {
  fill: #9ca5ac;
  font-size: 9px;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-variant-numeric: tabular-nums;
}
.scope-axis line:not(.scope-grid-major) {
  stroke: #9ca5ac;
  stroke-opacity: 0.35;
}
.scope-axis-title {
  fill: #a6b0b8;
  font-size: 7px;
  letter-spacing: 0.55px;
}
.scope-trace {
  fill: none;
  stroke-width: 1.65;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.scope-cursor {
  cursor: ew-resize;
  --cursor-color: #7cc8ea;
}
.scope-cursor--b {
  --cursor-color: #4cbb7a;
}
.scope-cursor > line {
  stroke: var(--cursor-color);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.7;
}
.scope-cursor--active > line,
.scope-cursor:focus-visible > line {
  opacity: 1;
  stroke-dasharray: 2 2;
}
.scope-cursor-hit {
  fill: transparent;
}
.scope-cursor-label {
  fill: var(--cursor-color);
}
.scope-cursor text {
  fill: #151c23;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}
.scope-cursor-point {
  stroke: #151c23;
  stroke-width: 1.2;
  pointer-events: none;
}
.scope-empty {
  position: absolute;
  inset: 20px 55px 25px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  pointer-events: none;
}
.scope-empty svg {
  color: #82929d;
  margin-bottom: 1px;
}
.scope-empty strong {
  color: #d0d9df;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.15px;
}
.scope-empty > span {
  max-width: 360px;
  color: #9da5aa;
  font-size: 10px;
  text-wrap: balance;
}
.scope-stale-overlay {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 7px;
  border-radius: 3px;
  background: #151c23e8;
  color: #ffdea1;
  font-size: 8px;
  letter-spacing: 1px;
  white-space: nowrap;
  pointer-events: none;
}

.scope-readouts {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  min-width: 0;
  min-height: 0;
  padding: 8px 12px;
  border-inline-start: 1px solid #d4dce217;
  background: #0b101515;
}
.scope-readout-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  color: #afb8be;
  font-size: 8px;
  letter-spacing: 1px;
}
.scope-readout-heading > span:last-child {
  color: #9da5aa;
  font-size: 9px;
  letter-spacing: 0;
  cursor: help;
}
.scope-cursor-inputs {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.scope-cursor-row {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}
.scope-cursor-row > button {
  width: 23px;
  height: 23px;
  flex-shrink: 0;
  padding: 0;
  color: #7cc8ea;
  background: transparent;
  border: 1px solid #7cc8ea4a;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 650;
}
.scope-cursor-row--b > button {
  color: #4cbb7a;
  border-color: #4cbb7a4a;
}
.scope-cursor-row--a > button[aria-pressed="true"] {
  color: #151c23;
  background: #7cc8ea;
}
.scope-cursor-row--b > button[aria-pressed="true"] {
  color: #151c23;
  background: #4cbb7a;
}
.scope-time-input {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 0;
  border-bottom: 1px solid #d4dce21c;
}
.scope-time-input input {
  width: 100%;
  min-width: 0;
  height: 23px;
  padding: 2px 0;
  color: #dae1e6;
  border: 0;
  border-radius: 2px;
  background: transparent;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  appearance: textfield;
}
.scope-time-input input::-webkit-inner-spin-button,
.scope-time-input input::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}
.scope-time-input input::placeholder {
  color: #899197;
}
.scope-time-input > span:last-child {
  padding-inline-end: 2px;
  color: #9da5aa;
  font-size: 10px;
}
.scope-outside {
  position: absolute;
  inset-inline-end: 12px;
  top: -6px;
  background: var(--scope-screen);
  color: #ffdea1;
  font-size: 7px;
  line-height: 1;
}
.scope-delta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 9px;
  color: #a5adb3;
}
.scope-delta > span {
  flex: 1;
  min-width: 0;
}
.scope-delta > span + span {
  padding-inline-start: 12px;
  border-inline-start: 1px solid #d4dce217;
}
.scope-delta small {
  font-size: 8px;
  color: #9da5aa;
  margin-inline-start: 3px;
}
.scope-delta output {
  display: block;
  margin-top: 1px;
  color: #dae1e6;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.scope-measurements {
  flex: 0 0 auto;
  max-height: 88px;
  min-height: 47px;
  overflow: auto;
  border-top: 1px solid #d4dce21c;
  scrollbar-width: thin;
  scrollbar-color: #424e56 #151c23;
}
.scope-measurements:focus-visible {
  outline-offset: -2px !important;
}
.scope-measurements table {
  width: 100%;
  min-width: 650px;
  border-collapse: separate;
  border-spacing: 0;
  text-align: end;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}
.scope-measurements th,
.scope-measurements td {
  height: 22px;
  padding: 3px 12px;
  white-space: nowrap;
  border-bottom: 1px solid #d4dce209;
  font-weight: 400;
}
.scope-measurements thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 21px;
  background: #192028;
  color: #a9b2b9;
  font-size: 9px;
}
.scope-measurements th:first-child {
  text-align: start;
}
.scope-measurements tbody th {
  max-width: 220px;
  color: #d0d9df;
}
.scope-measurements tbody th > span:nth-child(2) {
  display: inline-block;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}
.scope-measurements td {
  color: #d0d9df;
  font-family: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}
.scope-measurements tbody tr:hover {
  background: #d4dce205;
}
.scope-table-note {
  margin-inline-start: 5px;
  color: #969fa6;
  font-size: 8px;
  font-weight: 400;
}
.scope-table-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-inline-end: 8px;
  border-radius: 50%;
  vertical-align: middle;
}
.scope-measurements thead .scope-a-heading {
  color: #7cc8ea;
}
.scope-measurements thead .scope-b-heading {
  color: #4cbb7a;
}
.scope-measurement--hidden .scope-table-dot {
  opacity: 0.4;
}
.scope-measurements .scope-table-empty {
  color: #9da5aa;
  text-align: start;
  font-family: inherit;
  font-size: 10px;
}
.scope-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

@container scope (max-width: 850px) {
  .scope-display {
    grid-template-columns: minmax(0, 1fr) 225px;
  }
  .scope-readouts {
    padding: 8px 10px;
    gap: 5px;
  }
  .scope-capture-info {
    font-size: 8px;
  }
  .scope-capture-info .scope-gesture-hint {
    display: none;
  }
  .scope-measurements th,
  .scope-measurements td {
    padding-inline-start: 9px;
    padding-inline-end: 9px;
  }
}

@container scope (max-width: 620px) {
  .scope-header {
    flex-wrap: wrap;
    gap: 6px;
    padding: 9px 0;
  }
  .scope-heading {
    flex: 1 0 100%;
  }
  .scope-controls {
    width: 100%;
    justify-content: space-between;
  }
  .scope-controls button {
    height: 32px;
    min-width: 32px;
  }
  .scope-instrument {
    flex: 1 0 auto;
  }
  .scope-channel-bar {
    flex-wrap: wrap;
    gap: 3px;
    padding: 5px 8px;
  }
  .scope-channels {
    flex: 1 0 100%;
  }
  .scope-capture-info {
    padding-inline-start: 4px;
  }
  .scope-display {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto;
  }
  .scope-plot {
    min-height: 175px;
  }
  .scope-readouts {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 6px 14px;
    padding: 9px 12px;
    border-inline-start: 0;
    border-top: 1px solid #d4dce217;
  }
  .scope-readout-heading {
    grid-column: 1 / -1;
  }
  .scope-cursor-row > button {
    width: 26px;
    height: 26px;
  }
  .scope-time-input input {
    height: 26px;
    font-size: 11px;
  }
  .scope-delta {
    align-items: center;
  }
  .scope-delta > span + span {
    padding-inline-start: 8px;
  }
  .scope-delta output {
    font-size: 10px;
  }
  .scope-measurements {
    max-height: 98px;
  }
  .scope-measurements th,
  .scope-measurements td {
    height: 27px;
  }
  .scope-empty {
    inset-inline-start: 40px;
    inset-inline-end: 40px;
  }
  .scope-empty strong {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scope * {
    transition: none !important;
  }
}
/* The Bode plot, drawn on the oscilloscope's screen. */
.bode-plot {
  flex: 1;
  touch-action: pan-y;
}
.bode .scope-instrument {
  min-height: 0;
}
.bode-corner {
  fill: var(--scope-screen);
  stroke-width: 1.6;
}
.bode-cursor {
  stroke: #e7ecef;
  stroke-opacity: 0.55;
  stroke-width: 1;
  stroke-dasharray: 2 3;
}
.bode-empty {
  pointer-events: none;
}
/* Words on the instrument are set in the UI's face in Arabic: the
   instrument's monospace faces have no Arabic letters, and the fallback
   draws each one apart instead of joined. */
[lang="ar"] .scope-axis-title,
[lang="ar"] .scope-measurements td.word {
  font-family: "Alexandria", "Segoe UI", Tahoma, sans-serif;
  letter-spacing: 0;
}
[lang="ar"] .scope-axis-title {
  font-size: 9px;
}
/* The view switch: waveforms, spectrum, XY. */
.scope-view {
  min-width: 34px;
  font-weight: 650;
  font-size: 10px;
}
.scope-view.active {
  background: #287092;
  color: #f1f5f8;
}
.xy-trace {
  stroke: var(--scope-orange);
}
.spectrum-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #d4dce21c;
  font-size: 10px;
}
.spectrum-row > span:not(.scope-table-dot) {
  grid-column: 2;
  color: #a6b0b8;
}
.spectrum-row output {
  color: #e7ecef;
  font-variant-numeric: tabular-nums;
}
.scope-note {
  font-size: 9.5px;
  line-height: 1.6;
  color: #a6b0b8;
  margin: 8px 0 0;
}
/* The spectrum's readouts can outgrow the panel: it scrolls. */
.scope-readouts {
  overflow-y: auto;
}

:root {
  font-family: "Inter", "Alexandria", "Segoe UI", Tahoma, sans-serif;
  color: #283239;
  background: #f2f5f7;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  font-size: 12px;
  font-weight: 400;
  --ink: #283239;
  --muted: #7c8388;
  --line: #dadfe3;
  --paper: #f2f5f7;
  --green: #1f739a;
  --orange: #24a9e0;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  color: inherit;
}
button:disabled {
  cursor: not-allowed;
  opacity: 0.35;
}
button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid #24a9e0;
  outline-offset: 3px;
}
button {
  border: 0;
  background: none;
}
input,
select {
  min-width: 0;
  color: var(--ink);
}
svg {
  flex-shrink: 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}
kbd,
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}
kbd {
  font-size: 10px;
  color: #8c9194;
}
button:hover kbd {
  color: #286c8b;
}
.app {
  height: 100dvh;
  min-height: 680px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app-header {
  height: 72px;
  flex-shrink: 0;
  background: #f8fafb;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 26px;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}
/* Dr.Machine embedding: return link to the platform's tools hub. */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
}
.back-link:hover {
  background: #e8edf1;
}
@media (max-width: 600px) {
  .back-link span {
    display: none;
  }
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: #d0d9df;
  color: #334049;
}
.brand strong {
  font-size: 18px;
  letter-spacing: 1.6px;
  font-weight: 750;
  line-height: 1.1;
}
.brand strong span {
  display: block;
  font-size: 8px;
  letter-spacing: 3px;
  font-weight: 500;
  margin-top: 6px;
}
.header-divider {
  height: 27px;
  width: 1px;
  background: var(--line);
}
.header-description {
  color: #8b9094;
  font-size: 11px;
  letter-spacing: 0.2px;
}
.header-actions {
  margin-inline-start: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}
.local-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  color: #7a8186;
  margin-inline-end: 9px;
}
.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  background: #1a8f50;
  border-radius: 50%;
}
.status-dot.error {
  background: #ba1a1a;
}
.status-dot.stale {
  background: #b07a00;
}
.button {
  border: 1px solid #d0d7dc;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  background: #f8fafc;
  line-height: 1.2;
  font-size: 11px;
  font-weight: 550;
  transition: background 0.12s;
}
.button:hover {
  background: #e2e9ee;
}
.button.subtle {
  border-color: transparent;
  background: none;
}
.project-bar {
  height: 58px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 25px;
  border-bottom: 1px solid var(--line);
  background: #edf1f4;
}
.project-name {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.project-icon {
  color: #737e85;
}
.project-name input {
  background: transparent;
  border: 0;
  padding: 5px 0;
  font-size: 13px;
  font-weight: 550;
  width: 200px;
  max-width: 36vw;
  text-overflow: ellipsis;
}
.version-tag {
  font-size: 8px;
  letter-spacing: 0.7px;
  color: #878d92;
  padding: 4px 6px;
  border: 1px solid #d3dadf;
  border-radius: 4px;
}
.project-actions {
  display: flex;
  align-items: center;
  gap: 19px;
}
.text-button {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  padding: 7px 0;
  color: #787e83;
}
.text-button:hover {
  color: #0b658f;
}
.vertical-rule {
  height: 18px;
  width: 1px;
  flex-shrink: 0;
  background: var(--line);
  margin: 0 4px;
}
.example-button {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
}
.example-button > svg:first-child {
  color: #6a8090;
}
.workbench {
  display: grid;
  grid-template-columns: 220px minmax(400px, 1fr) 272px;
  flex: 1;
  min-height: 0;
}
.library {
  padding: 23px 16px 0;
  border-inline-end: 1px solid var(--line);
  background: #ebeff2;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
}
.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 3px 19px;
}
.library-heading h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
}
.library-heading > span {
  font-size: 10px;
  color: #868f95;
  font-family: monospace;
}
.search-field {
  height: 33px;
  border: 1px solid #d4dce2;
  background: #f4f7f9;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 5px;
  padding: 0 9px;
  color: #899197;
  margin-bottom: 24px;
}
.search-field input {
  border: 0;
  outline: 0;
  background: transparent;
  width: 100%;
  font-size: 10px;
}
.search-field input::placeholder {
  color: #8f9599;
}
.search-field kbd {
  border: 1px solid #d9e1e6;
  width: 15px;
  text-align: center;
  border-radius: 3px;
}
.section-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 8px;
  color: #7f8a91;
  letter-spacing: 1.15px;
  font-weight: 600;
  margin-bottom: 13px;
}
.section-caption > span {
  letter-spacing: 0.45px;
  font-size: 8px;
  font-weight: 400;
}
.component-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.library-part {
  display: flex;
  align-items: center;
  width: 100%;
  height: 58px;
  padding: 8px 9px;
  text-align: start;
  gap: 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  transition: background 0.15s;
}
.library-part:hover {
  background: #dee6eb;
}
.library-part.active {
  border-color: #8ea2b1;
  background: #dce6ee;
}
.library-part > kbd {
  margin-inline-start: auto;
  color: #939da4;
}
.library-symbol {
  display: grid;
  place-items: center;
  width: 36px;
  height: 35px;
  border: 1px solid #d3dce3;
  border-radius: 5px;
  background: #f5f8fa;
  color: #55626c;
}
.library-symbol svg {
  width: 32px;
  height: 26px;
}
.library-symbol .symbol-small {
  display: none;
}
.library-part-name {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}
.library-part-name small {
  display: block;
  font-size: 9px;
  font-weight: 400;
  color: #848d94;
  margin-top: 5px;
}
.library-probes {
  margin: 24px 4px 10px;
  border-top: 1px solid #d5dde3;
  padding-top: 18px;
}
.library-probes > button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 34px;
  font-size: 10px;
  color: #65737d;
}
.library-probes kbd {
  margin-inline-start: auto;
}
.library-probes button:hover {
  color: var(--green);
}
.library-bottom {
  margin-top: auto;
  padding: 20px 3px 16px;
}
.connection-guide {
  border: 1px dashed #ccd5db;
  border-radius: 7px;
  padding: 9px 8px;
  color: #788792;
}
.connection-guide > div {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 9px;
  line-height: 27px;
}
.library-bottom > p {
  font-size: 10px;
  color: #8f9ba3;
  line-height: 1.7;
  margin: 17px 0;
}
.library-bottom > button {
  padding: 10px 0 0;
  border-top: 1px solid #d5dde2;
  width: 100%;
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: #778690;
}
.library-bottom > button > span {
  border: 1px solid #cfd8de;
  border-radius: 4px;
  padding: 0 4px;
}
.center-workspace {
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.editor-toolbar {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 15px;
  background: #f9fbfc;
  border-bottom: 1px solid var(--line);
  z-index: 1;
}
.tools {
  display: flex;
  align-items: center;
  gap: 3px;
}
.tools > button {
  width: 29px;
  height: 29px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  color: #808990;
}
.tools > button > svg {
  width: 15px;
  height: 15px;
}
.tools > button:hover:not(:disabled) {
  background: #e6ecf1;
  color: #2a6e8e;
}
.tools > button.active {
  background: #d6e2eb;
  color: #516675;
  box-shadow: inset 0 0 0 1px #cdd6dc;
}
.analysis-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.analysis-controls > select {
  border: 0;
  background: transparent;
  color: #69737a;
  font-size: 10px;
  max-width: 137px;
  padding: 5px 0;
  cursor: pointer;
}
.run-button {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  background: #287092;
  color: #f1f5f8;
  border: 1px solid #226686;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 550;
  box-shadow: 0 1px 2px #17465c14;
}
.run-button:hover {
  background: #185c7b;
}
.run-button.running {
  background: #ba1a1a;
  border-color: #93000a;
}
.reset-button {
  display: grid;
  place-items: center;
  color: #828d95;
  width: 24px;
  height: 28px;
}
.schematic-region {
  flex: 1;
  min-height: 285px;
  display: flex;
  flex-direction: column;
  position: relative;
}
.canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #f2f5f7;
}
.schematic {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  user-select: none;
}
.canvas-heading {
  position: absolute;
  inset-inline-start: 22px;
  inset-inline-end: 22px;
  top: 20px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.eyebrow {
  font-size: 8px;
  letter-spacing: 1.5px;
  color: #889096;
  font-weight: 500;
}
.canvas-chip {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 8px;
  border: 1px solid #dce2e6;
  padding: 5px 8px;
  border-radius: 4px;
  color: #859097;
  background: #f4f7f9b8;
}
.canvas-chip .status-dot {
  width: 4px;
  height: 4px;
}
.canvas-bottom {
  position: absolute;
  bottom: 12px;
  inset-inline-start: 17px;
  inset-inline-end: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  pointer-events: none;
}
.canvas-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 9px;
  line-height: 1.5;
  color: #8d969c;
  background: #f2f5f7e8;
  padding: 5px 4px;
  max-width: 70%;
}
.canvas-zoom {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f9fbfc;
  border: 1px solid #d5dee4;
  border-radius: 5px;
  box-shadow: 0 2px 6px #23303d20;
  pointer-events: auto;
  height: 30px;
  padding: 0 3px;
}
.canvas-zoom > button {
  display: grid;
  place-items: center;
  width: 23px;
  height: 25px;
  color: #6c7c87;
}
.canvas-zoom > button:hover {
  background: #dfe8ef;
}
.canvas-zoom > span {
  font-size: 9px;
  font-family: monospace;
  color: #748088;
  min-width: 32px;
  text-align: center;
}
.canvas-zoom > button:last-child {
  border-inline-start: 1px solid #dae2e7;
  margin-inline-start: 3px;
  padding-inline-start: 6px;
  width: 29px;
}
.wire-line {
  fill: none;
  stroke: #788690;
  stroke-width: 2;
  pointer-events: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wire-hit {
  fill: none;
  stroke: transparent;
  stroke-width: 13;
  cursor: pointer;
}
.wire.highlighted .wire-line {
  stroke: #1a8f50;
  stroke-width: 3;
}
.wire.selected .wire-line {
  stroke: #24a9e0;
  stroke-width: 3;
}
.bend-handle {
  stroke: #1d93c6;
  stroke-width: 1.5;
  fill: #f0f9fe;
  cursor: move;
}
.component {
  color: #4a5862;
  cursor: grab;
}
.component:active {
  cursor: grabbing;
}
.component-hit {
  fill: #f2f5f7;
  stroke: transparent;
  stroke-dasharray: 4 3;
  stroke-width: 1.3;
}
.component:hover .component-hit {
  stroke: #b2c0ca;
}
.component.selected .component-hit {
  stroke: #5eb5dd;
  fill: #e5edf2;
}
.component.selected {
  color: #1f6586;
}
.component-id {
  font-size: 12px;
  font-family: Consolas, "Liberation Mono", monospace;
  fill: #4b5862;
  font-weight: 600;
}
.component-value {
  font-size: 10px;
  fill: #818b93;
  font-family: Consolas, "Liberation Mono", monospace;
}
.reference-arrow {
  stroke: #96a1a9;
  stroke-width: 1;
  fill: none;
}
.reference-arrow > text {
  font: italic 9px Georgia;
  fill: #96a1a9;
  stroke: none;
}
.symbol-small {
  font-size: 8px;
  stroke: none;
  fill: currentColor;
}
.pin {
  cursor: crosshair;
}
.pin-dot {
  fill: #f2f5f7;
  stroke: #7b9fcc;
  stroke-width: 1.5;
}
.pin.connected .pin-dot {
  stroke: #717f89;
  fill: #717f89;
}
.pin:hover .pin-dot,
.pin.wiring .pin-dot {
  stroke: #24a9e0;
  fill: #24a9e0;
  r: 5;
}
.junction {
  cursor: move;
}
.junction-dot {
  fill: #6d7d88;
  stroke: #f2f5f7;
  stroke-width: 1;
}
.junction.selected .junction-dot {
  fill: #24a9e0;
}
.net-label {
  cursor: pointer;
  font-family: Consolas, "Liberation Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.8px;
  fill: #707e88;
}
.net-label > rect {
  fill: #e1e9ee;
  stroke: #cfd7dd;
  stroke-width: 0.7;
}
.net-label:hover > rect {
  stroke: #85c2de;
}
.probe-overlay {
  cursor: pointer;
  font-family: monospace;
  font-size: 8px;
}
.probe-overlay > circle {
  fill: currentColor;
  fill-opacity: 0.13;
  stroke: currentColor;
  stroke-width: 1;
}
.probe-overlay > text {
  fill: currentColor;
  font-weight: 600;
}
.probe-overlay .probe-reading {
  font-size: 10px;
  font-weight: 400;
}
.wire-preview {
  stroke: #24a9e0;
  stroke-width: 2;
  stroke-dasharray: 5 4;
  fill: none;
  pointer-events: none;
}
.tool-wire,
.tool-junction,
.tool-voltageProbe,
.tool-currentProbe,
.tool-label,
[class*="tool-place-"] {
  cursor: crosshair;
}
.tool-pan {
  cursor: grab;
}
.tool-pan:active {
  cursor: grabbing;
}
.tool-pan .component,
.tool-pan .wire-hit {
  cursor: grab;
}
.empty-canvas {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #8f9ca5;
  pointer-events: none;
  white-space: nowrap;
}
.empty-canvas h2 {
  font-family: "Space Grotesk", "Alexandria", "Segoe UI", sans-serif;
  font-size: 24px;
  font-weight: 400;
  color: #5b6a75;
  margin: 20px 0 12px;
}
.empty-canvas p {
  font-size: 11px;
  line-height: 1.8;
}
.scope-region {
  height: 305px;
  flex-shrink: 0;
  min-width: 0;
}
.inspector {
  border-inline-start: 1px solid var(--line);
  background: #f6f9fb;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}
.inspector-tabs {
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  padding: 0 15px;
  gap: 17px;
}
.inspector-tabs > button {
  font-size: 10px;
  padding: 0 5px;
  color: #868f95;
  position: relative;
}
.inspector-tabs > button[aria-selected="true"] {
  color: #465865;
}
.inspector-tabs > button[aria-selected="true"]:after {
  content: "";
  position: absolute;
  bottom: -1px;
  inset-inline-start: 2px;
  inset-inline-end: 2px;
  height: 2px;
  background: #647e91;
}
.inspector-content {
  flex: 1;
  overflow-y: auto;
  padding: 23px 20px;
  scrollbar-width: thin;
  scrollbar-color: #cad4db transparent;
}
.part-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 27px;
}
.part-symbol {
  width: 42px;
  height: 44px;
  background: #e6edf2;
  border: 1px solid #d3dee6;
  border-radius: 6px;
  display: grid;
  place-items: center;
  color: #2f7ea3;
}
.part-symbol > svg {
  width: 39px;
  height: 34px;
}
.part-summary h2 {
  font-family: Consolas, monospace;
  font-size: 18px;
  margin: 0 0 4px;
  font-weight: 500;
}
.part-summary > div > span {
  font-size: 10px;
  color: #868f96;
}
.small-badge {
  margin-inline-start: auto;
  border: 1px solid #d8e0e6;
  border-radius: 4px;
  font-size: 8px;
  padding: 3px 5px;
  color: #808e98;
}
.property-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 10px;
  color: #76828b;
}
.field > span {
  line-height: 1.5;
}
.field > input,
.field > select,
.input-unit {
  border: 1px solid #d2dadf;
  border-radius: 5px;
  min-height: 35px;
  background: #fafcfd;
  width: 100%;
}
.field > input,
.field > select {
  padding: 8px 10px;
  font-size: 11px;
}
.input-unit {
  display: flex;
  align-items: center;
  padding-inline-end: 11px;
}
.input-unit input {
  flex: 1;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font-size: 12px;
  font-family: Consolas, monospace;
  border-radius: 5px;
}
.input-unit > span {
  font-size: 10px;
  color: #828f99;
}
.field-note {
  font-size: 10px;
  line-height: 1.8;
  color: #88939b;
  margin: 0 0 10px;
}
.field-note code {
  font-size: 10px;
  color: #6f808d;
}
.property-form .field-note {
  margin: 0;
}
.apply-button {
  width: 100%;
  justify-content: space-between;
  background: #dfe8ef;
  border-color: #ced7dd;
  color: #237094;
}
.apply-button:hover {
  background: #cedde8;
}
.part-actions {
  display: flex;
  align-items: center;
  margin-top: 16px;
  padding-bottom: 19px;
  border-bottom: 1px solid #d8e1e7;
  gap: 9px;
}
.part-actions button {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #808d96;
  font-size: 10px;
  padding: 6px 3px;
}
.part-actions button:hover {
  color: #155979;
}
.part-actions button:last-child {
  margin-inline-start: auto;
}
.separated {
  margin-top: 24px;
}
.connection-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  text-align: start;
  min-height: 34px;
  font-size: 9px;
}
.connection-row:hover {
  background: #e7eef3;
}
.pin-number {
  border: 1px solid #d2dce4;
  border-radius: 3px;
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  font-family: monospace;
  color: #748795;
  font-size: 8px;
}
.connection-row > code {
  margin-inline-start: auto;
  color: #798d9b;
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.current-readout {
  margin-top: 20px;
  border: 1px solid #d7e0e7;
  border-radius: 6px;
  background: #e9f0f5;
  padding: 14px;
}
.current-readout span {
  font-size: 8px;
  color: #7e8f9b;
  display: block;
}
.current-readout strong {
  display: block;
  margin-top: 10px;
  font-size: 21px;
  font-family: Consolas, monospace;
  font-weight: 400;
  color: #257499;
}
.inspector-empty {
  padding: 42px 4px;
  text-align: center;
  color: #8f9aa1;
}
.inspector-empty > svg {
  color: #a4b1bb;
  stroke-width: 1;
}
.inspector-empty h3 {
  font-family: "Space Grotesk", "Alexandria", "Segoe UI", sans-serif;
  font-size: 22px;
  font-weight: 400;
  margin: 21px 0 12px;
  color: #70828e;
}
.inspector-empty p {
  line-height: 1.9;
  font-size: 11px;
}
.netlist-link {
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 43px;
  flex-shrink: 0;
  padding: 0 18px;
  color: #6c7f8d;
  font-size: 10px;
  background: #e9eff4;
}
.netlist-link > span {
  display: flex;
  align-items: center;
  gap: 10px;
}
.netlist-link code {
  font-size: 12px;
}
.netlist-link:hover {
  background: #dfe8ef;
}
.entity-title {
  font-size: 16px;
  letter-spacing: -0.4px;
  font-weight: 500;
  margin: 20px 0;
}
.model-note {
  background: #e8eff4;
  border: 1px solid #d6e1e9;
  border-radius: 6px;
  padding: 12px;
  font-size: 10px;
  line-height: 1.8;
  color: #7c8c98;
  margin: 19px 0;
}
.model-note strong {
  font-size: 11px;
  color: #5e7483;
  font-weight: 550;
}
.model-note p {
  margin: 9px 0;
}
.model-note p:last-child {
  margin-bottom: 0;
}
.model-note code {
  font-size: 10px;
  display: inline-block;
  margin: 5px 0;
}
.checkbox-field {
  font-size: 11px;
  color: #617481;
  display: flex;
  align-items: center;
  gap: 7px;
}
.checkbox-field input {
  accent-color: #2188b8;
}
.danger {
  color: #ba1a1a;
}
.text-button.danger {
  margin-top: 15px;
}
.resource-note {
  border-top: 1px solid #d7e1e8;
  padding-top: 19px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #80929f;
  font-size: 9px;
  line-height: 1.8;
}
.resource-note strong {
  font-family: Consolas, monospace;
  font-size: 22px;
  color: #627c8e;
  font-weight: 400;
}
.readings-table > button,
.readings-table > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 35px;
  border-bottom: 1px solid #dee7ed;
  text-align: start;
  font-size: 10px;
  padding: 5px;
}
.readings-table > button:hover {
  background: #e3ecf2;
}
.readings-table code {
  color: #3185ac;
  font-size: 11px;
}
.error-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  background: #ffedea;
  border-bottom: 1px solid #f2b8b5;
  color: #ba1a1a;
  font-size: 11px;
  line-height: 1.6;
  max-height: 150px;
  overflow: auto;
  z-index: 2;
}
.error-banner > span {
  flex: 1;
}
.error-banner strong {
  font-size: 10px;
  display: block;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.error-banner button {
  padding: 0;
  display: grid;
  place-items: center;
  margin-top: 2px;
}
.simulation-progress {
  height: 30px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  background: #e0e9f0;
  color: #698395;
  font-size: 9px;
  border-bottom: 1px solid #cbd4db;
}
.simulation-progress progress {
  flex: 1;
  height: 5px;
  accent-color: #2398ce;
}
.simulation-progress strong {
  font-family: monospace;
  font-weight: 400;
  min-width: 30px;
}
.statusbar {
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  background: #e5ebf0;
  border-top: 1px solid #d0d9df;
  color: #808f99;
  font-size: 9px;
}
.statusbar > .status-dot {
  width: 4px;
  height: 4px;
}
.status-message {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}
.document-stats {
  white-space: nowrap;
  font-size: 8px;
  letter-spacing: 0.25px;
}
.document-stats > span {
  margin: 0 5px;
  color: #a4b1ba;
}
.revision-label,
.grid-label {
  font-family: monospace;
  font-size: 8px;
  border-inline-start: 1px solid #d0d9df;
  padding-inline-start: 12px;
  margin-inline-start: 6px;
  white-space: nowrap;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: #18212b66;
  backdrop-filter: blur(5px);
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 35px;
}
.modal {
  background: #f3f7f9;
  border: 1px solid #dbe4ea;
  border-radius: 14px;
  box-shadow: 0 20px 90px #121a2240;
  width: 850px;
  max-width: 100%;
  max-height: 90dvh;
  padding: 27px 32px 30px;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: #90c6df transparent;
}
.modal > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 25px;
}
.modal > header button {
  display: grid;
  place-items: center;
  color: #7b8f9e;
}
.modal > h1 {
  font-family: "Space Grotesk", "Alexandria", "Segoe UI", sans-serif;
  letter-spacing: -1px;
  font-weight: 400;
  font-size: 34px;
  margin: 0 0 13px;
  color: #1c5975;
}
.modal-intro {
  font-size: 12px;
  line-height: 1.8;
  color: #7b8e9b;
  margin-bottom: 26px;
  max-width: 650px;
}
.example-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.example-card {
  position: relative;
  text-align: start;
  border: 1px solid #cedce6;
  border-radius: 8px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  background: #eaf0f5;
  transition:
    background 0.15s,
    transform 0.15s;
  min-height: 254px;
}
.example-card:hover {
  background: #dce7ee;
  transform: translateY(-2px);
}
.example-number {
  font-family: monospace;
  color: #4fa3ca;
  font-size: 10px;
}
.example-mini {
  position: absolute;
  inset-inline-end: 15px;
  top: 16px;
  width: 46px;
  height: 32px;
  color: #2785b0;
}
.example-mini svg {
  width: 100%;
  height: 100%;
}
.example-card h2 {
  font-family: "Space Grotesk", "Alexandria", "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 21px;
  color: #206a8c;
  letter-spacing: -0.5px;
  margin: 30px 0 12px;
}
.example-card p {
  color: #788e9e;
  font-size: 10px;
  line-height: 1.8;
  flex: 1;
}
.example-open {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #cedce6;
  color: #3992bb;
  font-size: 10px;
}
.blank-example {
  border-style: dashed;
  background: transparent;
}
.blank-example > svg {
  color: #7d94a4;
  margin-bottom: 0;
}
.blank-example h2 {
  margin-top: 21px;
}
.net-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.net-chips button {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 1px solid #cedbe4;
  border-radius: 6px;
  background: #e6eef3;
  color: #3484a9;
  font-size: 11px;
}
.net-chips button > span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #49addc;
}
.net-chips button > span.ground-dot {
  background: #536978;
}
.net-chips small {
  font-size: 9px;
  color: #8198a8;
  margin-inline-start: 3px;
}
.netlist-code {
  max-height: 42vh;
  overflow: auto;
  border-radius: 8px;
  background: #1e262c;
  color: #88c3de;
  padding: 20px;
  font-size: 10px;
  line-height: 1.8;
  scrollbar-width: thin;
  scrollbar-color: #495964 #1e262c;
  margin-bottom: 22px;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
}
.help-grid h2 {
  font-family: "Space Grotesk", "Alexandria", "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 23px;
  color: #267fa8;
  margin: 0 0 13px;
}
.help-grid p {
  font-size: 11px;
  line-height: 1.9;
  color: #7b8f9d;
}
.help-grid kbd {
  border: 1px solid #cad4db;
  padding: 1px 4px;
  border-radius: 3px;
  background: #e7eff4;
  color: #3b99c4;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 22px 0;
}
.shortcut-grid > div {
  border: 1px solid #d4e0e8;
  border-radius: 5px;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.shortcut-grid kbd {
  color: #3b95be;
}
.shortcut-grid span {
  font-size: 10px;
  color: #899aa6;
}
.mobile-navigation {
  display: none;
}
@media (min-width: 901px) and (max-height: 820px) {
  .schematic-region {
    min-height: 160px;
  }
}
@media (min-width: 1650px) {
  .workbench {
    grid-template-columns: 235px minmax(400px, 1fr) 295px;
  }
  .scope-region {
    height: 330px;
  }
  .editor-toolbar {
    padding: 0 22px;
  }
  .tools {
    gap: 6px;
  }
  .inspector-content {
    padding: 26px;
  }
  .library-part {
    height: 61px;
  }
  .library {
    padding: 25px 20px 0;
  }
}
@media (max-width: 1300px) {
  .workbench {
    grid-template-columns: 195px minmax(350px, 1fr) 250px;
  }
  .header-description {
    display: none;
  }
  .app-header {
    padding: 0 20px;
  }
  .optional-tool {
    display: none !important;
  }
  .tools {
    gap: 1px;
  }
  .tools > button {
    width: 27px;
  }
  .editor-toolbar {
    padding: 0 10px;
    gap: 5px;
  }
  .analysis-controls {
    gap: 5px;
  }
  .analysis-controls > select {
    font-size: 9px;
    max-width: 112px;
  }
  .library {
    padding: 21px 12px 0;
  }
  .library-part {
    gap: 8px;
    padding: 7px 5px;
  }
  .library-part-name {
    font-size: 10px;
  }
  .library-part-name small {
    font-size: 8px;
  }
  .inspector-content {
    padding: 21px 16px;
  }
  .inspector-tabs {
    gap: 14px;
  }
  .scope-region {
    height: 300px;
  }
  .project-bar {
    padding: 0 20px;
  }
  .library-probes {
    margin-top: 18px;
  }
  .library-bottom {
    padding-top: 12px;
  }
}
@media (max-width: 1100px) {
  .workbench {
    grid-template-columns: 170px minmax(320px, 1fr) 228px;
  }
  .library-part > kbd {
    display: none;
  }
  .library-part {
    height: 53px;
  }
  .library-part-name {
    font-size: 9px;
  }
  .library-symbol {
    width: 30px;
    height: 31px;
  }
  .library-symbol svg {
    width: 28px;
  }
  .tools > button {
    width: 25px;
  }
  .tools .vertical-rule {
    display: none;
  }
  .analysis-controls > select {
    max-width: 83px;
  }
  .analysis-controls {
    gap: 3px;
  }
  .run-button {
    padding: 7px 9px;
  }
  .reset-button {
    display: none;
  }
  .editor-toolbar {
    padding: 0 7px;
  }
  .inspector-content {
    padding: 21px 13px;
  }
  .inspector-tabs {
    gap: 10px;
    padding: 0 10px;
  }
  .inspector-tabs > button {
    font-size: 9px;
  }
  .header-actions .local-badge {
    display: none;
  }
  .library-bottom .connection-guide {
    padding: 7px 5px;
  }
  .connection-guide > div {
    gap: 5px;
    font-size: 8px;
  }
  .project-name input {
    width: 180px;
  }
  .scope-region {
    height: 310px;
  }
  .canvas-heading {
    inset-inline-start: 15px;
    inset-inline-end: 15px;
  }
}
@media (max-width: 900px) {
  .app {
    min-height: 600px;
    height: 100dvh;
    overflow: auto;
  }
  .app-header {
    height: 63px;
    padding: 0 15px;
    gap: 10px;
  }
  .brand-mark {
    width: 33px;
    height: 33px;
  }
  .brand strong {
    font-size: 15px;
  }
  .brand strong span {
    font-size: 7px;
  }
  .header-divider {
    display: none;
  }
  .header-actions {
    gap: 7px;
  }
  .header-actions .subtle span {
    display: none;
  }
  .header-actions .button {
    padding: 8px 10px;
    font-size: 10px;
  }
  .project-bar {
    height: 53px;
    padding: 0 15px;
  }
  .version-tag {
    display: none;
  }
  .project-name {
    gap: 7px;
  }
  .project-name input {
    font-size: 12px;
    width: 185px;
  }
  .project-actions {
    gap: 12px;
  }
  .project-actions .text-button {
    font-size: 10px;
  }
  .example-button {
    font-size: 10px;
  }
  .mobile-navigation {
    display: flex;
    height: 39px;
    flex-shrink: 0;
    align-items: stretch;
    border-bottom: 1px solid var(--line);
    background: #eaf0f5;
  }
  .mobile-navigation button {
    flex: 1;
    font-size: 10px;
    color: #7e92a1;
    border-bottom: 2px solid transparent;
  }
  .mobile-navigation button.active {
    border-color: #2595c9;
    color: #1484b8;
    background: #e0e9f0;
  }
  .workbench {
    display: block;
    min-height: 0;
    flex: 1;
    position: relative;
  }
  .library,
  .inspector {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }
  .center-workspace {
    height: 100%;
    display: flex;
  }
  .mobile-library .library {
    display: flex;
    z-index: 3;
  }
  .mobile-library .center-workspace,
  .mobile-inspector .center-workspace {
    visibility: hidden;
  }
  .mobile-inspector .inspector {
    display: flex;
    z-index: 3;
  }
  .library {
    padding: 20px 25px;
  }
  .library-heading h2 {
    font-size: 16px;
  }
  .component-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
  }
  .library-part {
    height: 60px;
    border-color: #d1dde5;
    background: #f2f6f8;
    padding: 10px 15px;
    gap: 14px;
  }
  .library-part-name {
    font-size: 12px;
  }
  .library-part-name small {
    font-size: 9px;
  }
  .library-symbol {
    width: 40px;
    height: 38px;
  }
  .library-symbol svg {
    width: 35px;
  }
  .library-probes {
    margin: 20px 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
  }
  .library-probes .section-caption {
    width: 100%;
    margin-bottom: 0;
  }
  .library-probes > button {
    width: auto;
    flex: 1;
    gap: 9px;
  }
  .library-probes kbd {
    display: none;
  }
  .library-bottom {
    padding-bottom: 12px;
  }
  .connection-guide {
    display: flex;
    gap: 30px;
    justify-content: center;
  }
  .connection-guide > div {
    font-size: 10px;
  }
  .library-bottom > p {
    display: none;
  }
  .library-bottom > button {
    margin-top: 13px;
  }
  .editor-toolbar {
    padding: 0 13px;
    height: 47px;
    gap: 10px;
  }
  .tools > button {
    width: 29px;
  }
  .tools {
    gap: 3px;
  }
  .analysis-controls > select {
    max-width: 135px;
    font-size: 10px;
  }
  .analysis-controls {
    gap: 7px;
  }
  .run-button {
    padding: 8px 13px;
  }
  .reset-button {
    display: grid;
  }
  .scope-region {
    height: 300px;
    flex-shrink: 0;
  }
  .inspector-tabs {
    padding: 0 25px;
    gap: 30px;
  }
  .inspector-tabs > button {
    font-size: 12px;
  }
  .inspector-content {
    padding: 24px 28px;
  }
  .property-form {
    max-width: 530px;
  }
  .field,
  .field-note {
    font-size: 11px;
  }
  .field > input,
  .field > select,
  .input-unit {
    min-height: 40px;
  }
  .part-summary {
    max-width: 530px;
  }
  .part-actions,
  .connection-row,
  .current-readout {
    max-width: 530px;
  }
  .inspector-empty {
    max-width: 400px;
    margin: auto;
  }
  .statusbar {
    font-size: 8px;
    padding: 0 12px;
    height: 26px;
  }
  .revision-label,
  .grid-label {
    display: none;
  }
  .modal {
    padding: 22px;
    max-height: 93dvh;
  }
  .modal-backdrop {
    padding: 20px;
  }
  .modal h1 {
    font-size: 29px;
  }
  .help-grid {
    gap: 22px;
  }
  .example-grid {
    gap: 10px;
  }
  .example-card {
    padding: 14px;
  }
  .example-card h2 {
    font-size: 20px;
  }
  .scope-region .scope {
    min-height: 0;
  }
  .schematic-region {
    min-height: 260px;
  }
}
@media (max-width: 600px) {
  .app {
    min-height: 870px;
    height: auto;
    overflow: visible;
  }
  .app-header {
    padding: 0 12px;
  }
  .brand {
    gap: 9px;
  }
  .brand strong {
    font-size: 14px;
    letter-spacing: 1.1px;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
  }
  .brand-mark svg {
    width: 23px;
  }
  .header-actions .button {
    padding: 8px;
  }
  .header-actions .button > span {
    display: none;
  }
  .header-actions .subtle {
    padding: 8px;
  }
  .project-bar {
    padding: 0 12px;
    gap: 6px;
  }
  .project-name input {
    max-width: 37vw;
    font-size: 11px;
  }
  .project-icon {
    display: none;
  }
  .project-actions {
    gap: 12px;
  }
  .project-actions .text-button > span {
    display: none;
  }
  .project-actions .vertical-rule {
    display: none;
  }
  .example-button {
    font-size: 9px;
    gap: 5px;
  }
  .example-button svg {
    width: 13px;
  }
  .workbench {
    height: 830px;
    flex: none;
  }
  .center-workspace {
    height: 100%;
  }
  .editor-toolbar {
    height: auto;
    min-height: 78px;
    flex-wrap: wrap;
    gap: 5px;
    padding: 7px 10px;
  }
  .tools {
    flex: 1;
    gap: 6px;
    justify-content: space-between;
  }
  .tools > button {
    width: 28px;
    height: 28px;
  }
  .tools > button > svg {
    width: 15px;
    height: 15px;
  }
  .analysis-controls {
    width: 100%;
    justify-content: flex-end;
    gap: 10px;
  }
  .analysis-controls > select {
    margin-inline-end: auto;
    max-width: 180px;
  }
  .run-button {
    padding: 6px 18px;
  }
  .reset-button {
    display: grid;
  }
  .schematic-region {
    flex: 1;
    min-height: 290px;
  }
  .scope-region {
    height: 451px;
  }
  .canvas-heading {
    top: 14px;
    inset-inline-start: 13px;
    inset-inline-end: 13px;
  }
  .canvas-chip {
    font-size: 7px;
    padding: 4px 6px;
  }
  .eyebrow {
    font-size: 7px;
  }
  .canvas-hint {
    font-size: 8px;
    max-width: 60%;
    gap: 5px;
  }
  .canvas-bottom {
    inset-inline-start: 10px;
    inset-inline-end: 10px;
    bottom: 10px;
    gap: 6px;
  }
  .canvas-zoom {
    height: 27px;
  }
  .canvas-zoom > button {
    width: 21px;
    height: 22px;
  }
  .canvas-zoom > span {
    font-size: 8px;
    min-width: 28px;
  }
  .empty-canvas h2 {
    font-size: 22px;
  }
  .empty-canvas p {
    font-size: 10px;
  }
  .document-stats {
    display: none;
  }
  .statusbar {
    position: relative;
    height: 28px;
  }
  .modal-backdrop {
    padding: 10px;
  }
  .modal {
    padding: 17px;
    border-radius: 10px;
    max-height: 95dvh;
  }
  .modal > header {
    margin-bottom: 19px;
  }
  .modal h1 {
    font-size: 27px;
  }
  .modal-intro {
    font-size: 11px;
    margin-bottom: 20px;
  }
  .example-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .example-card {
    padding: 13px;
    min-height: 244px;
  }
  .example-card h2 {
    font-size: 19px;
  }
  .example-card p {
    font-size: 9px;
  }
  .example-mini {
    width: 35px;
    inset-inline-end: 10px;
  }
  .example-open {
    font-size: 9px;
  }
  .help-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .shortcut-grid {
    grid-template-columns: 1fr 1fr;
  }
  .connection-guide {
    gap: 12px;
  }
  .connection-guide > div {
    font-size: 8px;
    gap: 7px;
  }
  .component-list {
    gap: 8px;
  }
  .library {
    padding: 22px 15px;
  }
  .library-part {
    gap: 9px;
    padding: 8px;
    height: 66px;
  }
  .library-part-name {
    font-size: 10px;
  }
  .library-part-name small {
    font-size: 8px;
  }
  .library-symbol {
    width: 34px;
    height: 34px;
  }
  .library-probes > button {
    font-size: 9px;
  }
  .library-probes {
    gap: 8px;
  }
  .inspector-tabs {
    gap: 25px;
  }
  .inspector-content {
    padding: 23px;
  }
  .empty-canvas {
    white-space: normal;
    width: 90%;
  }
}

/* ── Dr.Machine: Arabic / RTL ─────────────────────────────────────────────
   The UI mirrors (logical properties above), but circuit geometry does not:
   schematic coordinates and the oscilloscope's time axis run left→right in
   every language, so every SVG and the plot overlays stay LTR. */
svg,
.scope-plot {
  direction: ltr;
}
/* Values carry their own direction: "-5 V", "4.7k", "R1:0" and JSON paths must
   not be reordered inside an RTL row; Arabic names typed by the user still are. */
input,
code,
output,
kbd,
td,
.readings-table span,
.current-readout strong,
.resource-note strong,
.scope-channel-name {
  unicode-bidi: plaintext;
}
.app[dir="rtl"],
.app[dir="rtl"] .scope {
  font-family: "Alexandria", "Inter", "Segoe UI", Tahoma, sans-serif;
}
/* Letter-spacing breaks Arabic letter joining. */
.app[dir="rtl"] * {
  letter-spacing: normal !important;
}
/* Directional icons (back, undo/redo, "apply ›") point the other way in RTL. */
.app[dir="rtl"] .rtl-flip {
  transform: scaleX(-1);
}
/* Upstream sets many captions at 7-9px; Arabic glyphs are unreadable there. */
.app[dir="rtl"]
  :is(
    .brand strong span,
    .version-tag,
    .section-caption,
    .section-caption > span,
    .library-part-name,
    .library-part-name small,
    .connection-guide > div,
    .library-bottom > button,
    .library-probes > button,
    .eyebrow,
    .canvas-chip,
    .canvas-hint,
    .connection-row,
    .current-readout span,
    .resource-note,
    .simulation-progress,
    .statusbar,
    .document-stats,
    .net-chips small,
    .analysis-controls > select,
    .inspector-tabs > button,
    .example-button,
    .example-card p,
    .example-open,
    .scope-no-probes,
    .scope-stale-overlay,
    .scope-readout-heading,
    .scope-readout-heading > span:last-child,
    .scope-outside,
    .scope-delta,
    .scope-measurements thead th,
    .scope-table-note,
    .scope-capture-info
  ) {
  font-size: 10px;
}
.app[dir="rtl"] .brand strong {
  font-size: 17px;
}
.attribution a {
  color: #0c6e9c;
}
/* Text overlays sit inside the LTR plot but are sentences in the UI language. */
.app[dir="rtl"] :is(.scope-empty, .scope-stale-overlay) {
  direction: rtl;
}
/* Monospace faces have no Arabic glyphs; fall back to the brand face, not a system one. */
.app[dir="rtl"] :is(kbd, code) {
  font-family: "SFMono-Regular", Consolas, "Alexandria", monospace;
}

/* ── Dr.Machine: language and theme controls (as in the site's navbar) ── */
.header-actions .lang-switch {
  gap: 5px;
  text-decoration: none;
}
.header-actions .lang-switch > .lang-code,
.header-actions .standard-switch > .lang-code {
  display: inline; /* stays visible where other button labels collapse */
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
}
.header-actions .theme-toggle {
  padding-inline: 8px;
}
/* IEC / ANSI: a four-character label must not resize the button when it
   changes to a three-character one. */
.header-actions .standard-switch > .lang-code {
  display: inline-block;
  min-width: 4ch;
  text-align: center;
}
@media (max-width: 600px) {
  /* Two more header controls: tighter spacing keeps the title on one line. */
  .header-actions {
    gap: 4px;
  }
  .header-actions .button,
  .header-actions .subtle {
    padding: 7px;
  }
  .brand strong {
    white-space: nowrap;
  }
}

/* ── Dr.Machine: school bench ── */
/* A meter's letter: large, filled, upright (the group counter-rotates it). */
.symbol-letter {
  font-size: 17px;
  font-weight: 700;
}
/* A meter's reading reads like a display, not like a part's rating. */
.component-value.meter-reading {
  font-weight: 700;
  opacity: 1;
}
/* A lit lamp: the halo and a warm core under the symbol's strokes. */
.lamp-glow {
  transition: opacity 0.25s ease;
}
.lamp-core {
  fill: #fff3b0;
}
/* Touch screens: a fingertip is wider than a cursor, so a pin or a junction
   takes a larger target there. The dot drawn keeps its size. */
@media (pointer: coarse) {
  .pin-hit,
  .junction-hit {
    r: 16;
  }
}
/* The first visit's welcome. */
.welcome-steps {
  list-style: none;
  counter-reset: step;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
  padding: 0;
}
.welcome-steps li {
  counter-increment: step;
  border: 1px solid #d4e0e8;
  border-radius: 8px;
  padding: 14px 16px;
}
.welcome-steps h2 {
  font-family: "Space Grotesk", "Alexandria", "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 19px;
  color: #267fa8;
  margin: 0 0 8px;
}
.welcome-steps h2::before {
  content: counter(step) " ";
  color: #90c6df;
}
.welcome-steps p {
  font-size: 11px;
  line-height: 1.9;
  color: #7b8f9d;
  margin: 0;
}
.welcome-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 6px 0 16px;
}
.button.primary {
  background: #287092;
  border-color: #226686;
  color: #f1f5f8;
}
.button.primary:hover {
  background: #185c7b;
}
@media (max-width: 600px) {
  .welcome-steps {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .welcome-actions .button {
    flex: 1 1 100%;
  }
}
/* A phone's header must fit its width. It did not: on a 375 px screen the
   name, the six buttons and the back link came to 419 px, and the whole page
   scrolled sideways. The name may now shrink (an ellipsis on the narrowest
   screens), and below 440 px its mark gives way and the spacing tightens. */
@media (max-width: 600px) {
  .brand,
  .brand strong {
    min-width: 0;
  }
  .brand strong,
  .brand strong span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
@media (max-width: 440px) {
  .brand-mark {
    display: none;
  }
  .app-header {
    padding: 0 8px;
    gap: 6px;
  }
  .back-link {
    padding-inline: 7px;
  }
}
/* A switch's OPEN / CLOSED is a word: in the UI's face, whose Arabic joins
   (the value line's monospace face has no Arabic letters). */
.component-value.switch-word {
  font-family: inherit;
  font-size: 11px;
}
/* A switch is flipped by clicking it. */
.tool-select .component.switch .component-hit {
  cursor: pointer;
}
.switch-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border: 1px solid #d4e0e8;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 550;
  color: #5d6f7c;
}
.switch-state.closed {
  border-color: #9fd3b4;
  color: #2e7d52;
}
/* The scope region holds the oscilloscope and the Bode plot; the analysis
   mode shows one. The slot adds no box of its own. */
.instrument-slot {
  display: contents;
}
.instrument-slot[hidden] {
  display: none;
}
/* An LED past the current a real one survives. */
.component-value.led-over {
  fill: #d93025;
  font-weight: 700;
}
/* Current on the wires: a dot every 14 units, travelling one spacing per
   animation period; the direction is set per wire from the current's sign. */
.flow {
  fill: none;
  stroke: #f2b200;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 0.1 14;
  animation: flow linear infinite;
}
@keyframes flow {
  to {
    stroke-dashoffset: -14.1;
  }
}
@media (prefers-reduced-motion: reduce) {
  .flow {
    animation: none;
  }
}
/* A part's value on a slider. */
.slider-field > span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}
.slider-field output {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  direction: ltr;
}
.slider-field input[type="range"] {
  width: 100%;
  accent-color: #287092;
}
/* A voltage probe's reference point: a small minus in the probe's colour. */
.probe-reference circle {
  fill: #f2f5f7; /* the canvas */
  stroke: currentColor;
  stroke-width: 1.4;
}
.probe-reference text {
  fill: currentColor;
  font-size: 11px;
  font-weight: 700;
}
/* An exercise: its task above the schematic, and the lab's mark. */
.exercise-banner {
  flex-shrink: 0;
  display: grid;
  gap: 6px;
  padding: 12px 18px 13px;
  background: #e8f2f8;
  border-bottom: 1px solid #c7dbe7;
  max-height: 40vh;
  overflow-y: auto;
}
.exercise-banner[hidden] {
  display: none;
}
.exercise-banner.solved {
  background: #e7f4ed;
  border-bottom-color: #bfdfcc;
}
.exercise-heading {
  display: flex;
  align-items: center;
  gap: 10px;
}
.exercise-eyebrow {
  color: #1f739a;
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.8px;
}
.exercise-solved {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #cfe9da;
  color: #1a6b43;
  font-size: 10px;
  font-weight: 650;
}
.exercise-close {
  margin-inline-start: auto;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 5px;
  color: #6d7d88;
}
.exercise-close:hover {
  background: #d6e5ee;
}
.exercise-task {
  margin: 0;
  max-width: 72ch;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.7;
}
.exercise-target {
  margin: 0;
  color: #5f7280;
  font-size: 11px;
}
.exercise-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 2px;
}
.exercise-verdict {
  font-size: 12px;
  font-weight: 550;
  line-height: 1.5;
}
.exercise-verdict.right {
  color: #1a6b43;
}
.exercise-verdict.wrong {
  color: #a8322a;
}
.exercise-hint {
  margin: 0;
  max-width: 72ch;
  color: #4f6371;
  font-size: 11px;
  line-height: 1.7;
}
/* The examples dialog, a group at a time. */
.example-group {
  margin: 4px 0 10px;
  color: #5c7688;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.4px;
}
@media (max-width: 600px) {
  .exercise-banner {
    padding: 10px 14px 11px;
  }
  .exercise-task {
    font-size: 12px;
  }
}

/* Dark theme — the platform's dark palette (static/css/tokens.css) applied
   to the lab. Active under `html.dark`, the class the platform's theme
   controller (static/js/dm-theme.js) sets; light mode is style.css/scope.css
   unchanged. First generated from those files by mapping every colour by role
   (surface / text / line / drawing) onto the dark tokens; maintained by hand
   since. The oscilloscope's instrument is dark already and is not overridden. */

html.dark {
  color-scheme: dark;
}

/* ── scope.css ── */

html.dark .scope {
  --scope-ivory: #121416;
  --scope-ink: #d9e5ee;
  --scope-sage: #54bd7b;
  --scope-orange: #32b2e9;
  border-top: 1px solid #deeaf336;
}
html.dark .scope-status {
  color: #c4cfd7;
}
html.dark .scope-status--stale {
  color: #e4b567;
}
html.dark .scope-controls button:hover:not(:disabled) {
  background: #deeaf30f;
  border-color: #deeaf32e;
}
html.dark .scope-control-divider {
  background: #deeaf336;
}
html.dark .scope-controls .scope-export {
  border-color: #deeaf340;
  background: #eeeeee12;
}
html.dark .scope-controls .scope-export:hover:not(:disabled) {
  background: #1c2022;
}

/* ── style.css ── */

html.dark {
  color: #e2e2e5;
  background: #121416;
  --ink: #e2e2e5;
  --muted: #aeb8bf;
  --line: #3e484f;
  --paper: #121416;
  --green: #61afd9;
  --orange: #32b2e9;
}
html.dark button:focus-visible,
html.dark input:focus-visible,
html.dark select:focus-visible,
html.dark a:focus-visible {
  outline: 2px solid #28ace3;
}
html.dark kbd {
  color: #b8bec1;
}
html.dark button:hover kbd {
  color: #85c8ea;
}
html.dark .app-header {
  background: #171919;
}
html.dark .back-link:hover {
  background: #181c1f;
}
html.dark .brand-mark {
  background: #2b3135;
  color: #cfdde7;
}
html.dark .header-description {
  color: #b8bec2;
}
html.dark .local-badge {
  color: #bcc3c9;
}
html.dark .button {
  border: 1px solid #42474b;
  background: #17191a;
}
html.dark .button:hover {
  background: #1b2024;
}
html.dark .project-bar {
  background: #15181a;
}
html.dark .project-icon {
  color: #bac6cd;
}
html.dark .version-tag {
  color: #b9bfc4;
  border: 1px solid #3f4549;
}
html.dark .text-button {
  color: #bec4ca;
}
html.dark .text-button:hover {
  color: #7bc8f7;
}
html.dark .example-button > svg:first-child {
  color: #aac1d3;
}
html.dark .library {
  background: #171a1c;
}
html.dark .library-heading > span {
  color: #b6bfc6;
}
html.dark .search-field {
  border: 1px solid #3d4449;
  background: #141617;
  color: #b6bec4;
}
html.dark .search-field input::placeholder {
  color: #b6bcc1;
}
html.dark .search-field kbd {
  border: 1px solid #3a4044;
}
html.dark .section-caption {
  color: #b6c1c9;
}
html.dark .library-part:hover {
  background: #1e2427;
}
html.dark .library-part.active {
  border-color: #6a737a;
  background: #1e2428;
}
html.dark .library-part > kbd {
  color: #b0bbc2;
}
html.dark .library-symbol {
  border: 1px solid #3d444a;
  background: #151718;
  color: #c3d0da;
}
html.dark .library-part-name small {
  color: #b6c0c7;
}
html.dark .library-probes {
  border-top: 1px solid #3d4348;
}
html.dark .library-probes > button {
  color: #bccad3;
}
html.dark .connection-guide {
  border: 1px dashed #42494e;
  color: #b6c3cc;
}
html.dark .library-bottom > p {
  color: #afbcc4;
}
html.dark .library-bottom > button {
  border-top: 1px solid #3d4347;
  color: #b6c3cd;
}
html.dark .library-bottom > button > span {
  border: 1px solid #40474c;
}
html.dark .editor-toolbar {
  background: #181a1a;
}
html.dark .tools > button {
  color: #b8c1c9;
}
html.dark .tools > button:hover:not(:disabled) {
  background: #191d21;
  color: #85c8eb;
}
html.dark .tools > button.active {
  background: #22282d;
  color: #c1cfd9;
  box-shadow: inset 0 0 0 1px #ffffff0f;
}
html.dark .analysis-controls > select {
  color: #bec9d1;
}
html.dark .run-button {
  border: 1px solid #66a8ca;
  box-shadow: 0 1px 2px #00000032;
}
html.dark .run-button.running {
  border-color: #f66d61;
}
html.dark .reset-button {
  color: #b5c0c9;
}
html.dark .canvas-wrap {
  background: #121416;
}
html.dark .eyebrow {
  color: #b6bec5;
}
html.dark .canvas-chip {
  border: 1px solid #3a3f42;
  color: #b4bfc7;
  background: #eceff114;
}
html.dark .canvas-hint {
  color: #b3bdc3;
  background: #eceff114;
}
html.dark .canvas-zoom {
  background: #181a1a;
  border: 1px solid #3b4348;
  box-shadow: 0 2px 6px #00000050;
}
html.dark .canvas-zoom > button {
  color: #b9c7d0;
}
html.dark .canvas-zoom > button:hover {
  background: #1c2226;
}
html.dark .canvas-zoom > span {
  color: #b8c5ce;
}
html.dark .canvas-zoom > button:last-child {
  border-inline-start: 1px solid #394044;
}
html.dark .wire-line {
  stroke: #9ba8b1;
}
html.dark .wire.highlighted .wire-line {
  stroke: #54bd7b;
}
html.dark .wire.selected .wire-line {
  stroke: #32b2e9;
}
html.dark .bend-handle {
  stroke: #46b1e5;
  fill: #11171b;
}
html.dark .component {
  color: #c6d4dd;
}
html.dark .component-hit {
  fill: #121416;
}
html.dark .component:hover .component-hit {
  stroke: #474d52;
}
html.dark .component.selected .component-hit {
  fill: #171d20;
}
html.dark .component.selected {
  color: #84c8ec;
}
html.dark .component-id {
  fill: #b9c6d0;
}
html.dark .component-value {
  fill: #99a3ac;
}
html.dark .reference-arrow {
  stroke: #8c969e;
}
html.dark .reference-arrow > text {
  fill: #8c969e;
}
html.dark .pin-dot {
  fill: #121416;
  stroke: #83a7d5;
}
html.dark .pin.connected .pin-dot {
  stroke: #9facb5;
  fill: #9facb5;
}
html.dark .pin:hover .pin-dot,
html.dark .pin.wiring .pin-dot {
  stroke: #32b2e9;
  fill: #32b2e9;
}
html.dark .junction-dot {
  fill: #a0adb7;
  stroke: #121416;
}
html.dark .junction.selected .junction-dot {
  fill: #32b2e9;
}
html.dark .net-label {
  fill: #a0adb6;
}
html.dark .net-label > rect {
  fill: #1b2124;
  stroke: #2d3337;
}
html.dark .wire-preview {
  stroke: #32b2e9;
}
html.dark .empty-canvas {
  color: #aebcc5;
}
html.dark .empty-canvas h2 {
  color: #c0cdd7;
}
html.dark .inspector {
  background: #161819;
}
html.dark .inspector-tabs > button {
  color: #b6bfc6;
}
html.dark .inspector-tabs > button[aria-selected="true"] {
  color: #c6d4de;
}
html.dark .part-symbol {
  background: #181d20;
  border: 1px solid #3b4349;
  color: #7cc9f1;
}
html.dark .part-summary > div > span {
  color: #b6bfc6;
}
html.dark .small-badge {
  border: 1px solid #3a4146;
  color: #b3c0ca;
}
html.dark .field {
  color: #b7c4ce;
}
html.dark .field > input,
html.dark .field > select,
html.dark .input-unit {
  border: 1px solid #3f454a;
  background: #191a1b;
}
html.dark .input-unit > span {
  color: #b3c0ca;
}
html.dark .field-note {
  color: #b3bec7;
}
html.dark .field-note code {
  color: #b8c5cf;
}
html.dark .apply-button {
  background: #1c2226;
  border-color: #40484d;
  color: #7fc8f0;
}
html.dark .apply-button:hover {
  background: #282e32;
}
html.dark .part-actions {
  border-bottom: 1px solid #394145;
}
html.dark .part-actions button {
  color: #b3c1ca;
}
html.dark .part-actions button:hover {
  color: #87c7ec;
}
html.dark .connection-row:hover {
  background: #171c1f;
}
html.dark .pin-number {
  border: 1px solid #3c444b;
  color: #b6c3cd;
}
html.dark .connection-row > code {
  color: #b4c1cb;
}
html.dark .current-readout {
  border: 1px solid #3a4147;
  background: #151a1d;
}
html.dark .current-readout span {
  color: #b3c0ca;
}
html.dark .current-readout strong {
  color: #7dc8f1;
}
html.dark .inspector-empty {
  color: #b1bcc3;
}
html.dark .inspector-empty > svg {
  color: #a8b5be;
}
html.dark .inspector-empty h3 {
  color: #b7c5ce;
}
html.dark .netlist-link {
  color: #b9c6cf;
  background: #161a1e;
}
html.dark .netlist-link:hover {
  background: #1c2226;
}
html.dark .model-note {
  background: #161b1e;
  border: 1px solid #394147;
  color: #b4c1cb;
}
html.dark .model-note strong {
  color: #bccad3;
}
html.dark .checkbox-field {
  color: #bccad3;
}
html.dark .danger {
  color: #fda296;
}
html.dark .resource-note {
  border-top: 1px solid #394146;
  color: #b2bfc9;
}
html.dark .resource-note strong {
  color: #a6c2d6;
}
html.dark .readings-table > button,
html.dark .readings-table > div {
  border-bottom: 1px solid #353c41;
}
html.dark .readings-table > button:hover {
  background: #181e22;
}
html.dark .readings-table code {
  color: #78c9f3;
}
html.dark .error-banner {
  background: #1c1413;
  color: #fda296;
}
html.dark .simulation-progress {
  background: #1b2125;
  color: #a6c2d5;
  border-bottom: 1px solid #424a50;
}
html.dark .statusbar {
  background: #1a1e22;
  border-top: 1px solid #3f464b;
  color: #b3c0c9;
}
html.dark .document-stats > span {
  color: #a8b5be;
}
html.dark .revision-label,
html.dark .grid-label {
  border-inline-start: 1px solid #3f464b;
}
html.dark .modal-backdrop {
  background: #dee9f599;
}
html.dark .modal {
  background: #131617;
  border: 1px solid #373e43;
  box-shadow: 0 20px 90px #00000099;
}
html.dark .modal > header button {
  color: #b3c0ca;
}
html.dark .modal > h1 {
  color: #8bc7e7;
}
html.dark .modal-intro {
  color: #b3c1ca;
}
html.dark .example-card {
  border: 1px solid #3d454b;
  background: #15191d;
}
html.dark .example-card:hover {
  background: #1d2327;
}
html.dark .example-number {
  color: #76caf2;
}
html.dark .example-mini {
  color: #72caf8;
}
html.dark .example-card h2 {
  color: #82c8ee;
}
html.dark .example-card p {
  color: #b4c1ca;
}
html.dark .example-open {
  border-top: 1px solid #3d454b;
  color: #73caf5;
}
html.dark .blank-example > svg {
  color: #aac2d2;
}
html.dark .net-chips button {
  border: 1px solid #3d464b;
  background: #161c20;
  color: #7bc9f1;
}
html.dark .net-chips small {
  color: #aac2d2;
}
html.dark .netlist-code {
  color: #8cc7e3;
}
html.dark .help-grid h2 {
  color: #76c9f5;
}
html.dark .help-grid p {
  color: #b3c0ca;
}
html.dark .help-grid kbd {
  border: 1px solid #424a50;
  background: #151b1f;
  color: #6fcaf7;
}
html.dark .shortcut-grid > div {
  border: 1px solid #394248;
}
html.dark .shortcut-grid kbd {
  color: #73caf5;
}
html.dark .shortcut-grid span {
  color: #afbdc6;
}
@media (max-width: 900px) {
  html.dark .mobile-navigation {
    background: #15191d;
  }
  html.dark .mobile-navigation button {
    color: #b2bfc9;
  }
  html.dark .mobile-navigation button.active {
    border-color: #41aadf;
    color: #6fc9fe;
    background: #1b2125;
  }
  html.dark .library-part {
    border-color: #3b444a;
    background: #121516;
  }
}
html.dark .attribution a {
  color: #76c8fb;
}

/* ── By hand ── */

/* SVG presentation colours set in the Rust views (canvas.rs, app.rs). */
html.dark .bridge-mask {
  fill: #121416; /* the canvas */
}
html.dark .bridge-arc {
  stroke: #9ba8b1; /* the wires */
}
html.dark .grid-dot {
  fill: #3a4147;
}
html.dark .guide-mask {
  stroke: #171a1c; /* the library */
}
/* The first visit's welcome. */
html.dark .welcome-steps li {
  border: 1px solid #394248;
}
html.dark .welcome-steps h2 {
  color: #76c9f5;
}
html.dark .welcome-steps h2::before {
  color: #3f7c9c;
}
html.dark .welcome-steps p {
  color: #b3c0ca;
}
html.dark .button.primary {
  background: #287092;
  border: 1px solid #66a8ca;
  color: #f1f5f8;
}
html.dark .button.primary:hover {
  background: #185c7b;
}
/* The switch's state in the inspector. */
html.dark .switch-state {
  border: 1px solid #394248;
  color: #b3c0ca;
}
html.dark .switch-state.closed {
  border-color: #2f6b4b;
  color: #7fd3a4;
}
html.dark .probe-reference circle {
  fill: #121416; /* the canvas */
}
html.dark .exercise-banner {
  background: #142029;
  border-bottom-color: #2c3d49;
}
html.dark .exercise-banner.solved {
  background: #13221a;
  border-bottom-color: #2a4535;
}
html.dark .exercise-eyebrow {
  color: #78c9f3;
}
html.dark .exercise-solved {
  background: #1f3d2c;
  color: #86d8a9;
}
html.dark .exercise-close {
  color: #a9b8c2;
}
html.dark .exercise-close:hover {
  background: #22313b;
}
html.dark .exercise-target,
html.dark .exercise-hint {
  color: #a9b8c2;
}
html.dark .exercise-verdict.right {
  color: #86d8a9;
}
html.dark .exercise-verdict.wrong {
  color: #fda296;
}
html.dark .example-group {
  color: #a6c2d5;
}
