.sd {
  --sd-pad: clamp(14px, 1.65vw, 23px);
  --sd-inset: #08182a;
  --sd-muted: #bfd3e3;
}

.sd .intro { padding-block: clamp(24px, 2.7vw, 40px) clamp(20px, 2vw, 32px); }
.sd-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  grid-template-areas: 'observing controls' 'plot challenge';
  gap: 18px;
  align-items: start;
}

.sd-observing { grid-area: observing; }
.sd-controls { grid-area: controls; }
.sd-challenge { grid-area: challenge; }
.sd-plot { grid-area: plot; }

.sd-heading { display: flex; align-items: start; justify-content: space-between; gap: 14px; padding: 19px var(--sd-pad) 14px; }
.sd-heading p, .sd-caption, .sd-challenge-body, .sd-notes { font-size: .85rem; line-height: 1.55; color: var(--sd-muted); }
.sd-heading p { margin: 5px 0 0; }
.sd-frames { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(9px, 1.2vw, 17px); margin-inline: var(--sd-pad); }
.sd-star { min-width: 0; border: 1px solid #35536b; border-radius: 11px; background: #0a1b2b; }
.sd-active { border-color: #4c829a; }
.sd-target-title { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 10px; padding: 10px clamp(8px, 1vw, 14px); }
.sd-target-title h3 { margin: 0; font-size: .97rem; letter-spacing: -.025em; }
.sd-target-title p { margin: 0; color: #f4c697; font-size: .9rem; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sd-active .sd-target-title p { color: #92e3fb; }
.sd-frame { height: clamp(163px, 17.2vw, 245px); background: #040913; border-block: 1px solid #334c61; overflow: hidden; }
.sd-frame canvas, .sd-plot-frame canvas { display: block; width: 100%; height: 100%; }

.sd-observation { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; margin: 0; padding: 11px clamp(8px, 1vw, 14px); }
.sd-observation dt, .sd-comparison dt { font-size: .74rem; line-height: 1.35; color: #b8cedd; }
.sd-observation dd { margin: 3px 0 0; color: #eff7fd; font-size: .94rem; font-weight: 680; font-variant-numeric: tabular-nums; }
.sd-observation dd span { white-space: nowrap; }
.sd-observation small { font-size: .69rem; font-weight: 520; color: #c2d8e8; }

.sd-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 13px var(--sd-pad) 0; border: 1px solid #41657d; border-radius: 9px; background: var(--sd-inset); }
.sd-comparison > div { display: flex; flex-direction: column; padding: 10px clamp(9px, 1.3vw, 17px); }
.sd-comparison > div + div { border-left: 1px solid #41657d; }
.sd-comparison dd { margin: auto 0 0; padding-top: 4px; color: #9ae7fd; font-variant-numeric: tabular-nums; font-size: clamp(1.04rem, 1.9vw, 1.65rem); font-weight: 720; letter-spacing: -.035em; }
.sd-caption { margin: 9px var(--sd-pad) 16px; }

.sd-controls { align-self: stretch; display: flex; flex-direction: column; }
.sd-controls .text-button { min-height: 44px; }
.sd-control-body { flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 17px; padding: 2px var(--sd-pad) 12px; }
.sd-controls .slider-block + .slider-block { margin-top: 0; }
.sd-controls .slider-block input { margin-top: 3px; }
.sd-controls .slider-ends { color: #b2c8db; }
.sd-preset-block h3 { margin: 0; font-size: .83rem; font-weight: 650; color: #d3e5f0; }
.sd-preset-block p { margin: 5px 0 8px; color: var(--sd-muted); font-size: .79rem; line-height: 1.5; }
.sd-presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.sd-presets .action { padding-inline: 4px; }
.sd-presets [aria-pressed=true] { background: #1d4860; border-color: #6ab4cb; }
.sd-equation { padding: 11px 13px; border: 1px solid #385b74; border-radius: 8px; background: #0a1e31; }
.sd-equation p { margin: 0; line-height: 1.55; color: #c6dbe9; font-size: .82rem; }
.sd-equation p:first-child { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 0 12px; padding-bottom: 7px; }
.sd-equation strong { color: #eff9ff; font-size: 1rem; font-weight: 650; white-space: nowrap; }
.sd-control-body > .text-button { align-self: start; margin-block: -9px; padding-inline: 0; }

.sd-plot-frame { height: clamp(196px, 18vw, 268px); border: 1px solid #355770; border-radius: 9px; background: var(--sd-inset); margin-inline: var(--sd-pad); overflow: hidden; }
.sd-key { display: flex; flex-wrap: wrap; gap: 6px 18px; list-style: none; padding: 0; margin: 11px var(--sd-pad) 0; color: #c6dce9; font-size: .75rem; }
.sd-key li { display: inline-flex; gap: 7px; align-items: center; }
.sd-key i { width: 17px; border-top: 2px solid #82defa; }
.sd-key .reference-line { border-top: 2px dashed #ecc897; }

.sd-challenge-body { padding: 0 var(--sd-pad) 16px; }
.sd-challenge-body p { margin: 0 0 14px; }
.sd-challenge-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.sd-challenge-body .sd-result { margin: 12px 0 8px; min-height: 3.6em; padding: 8px 11px; border: 1px solid #3e607a; border-radius: 8px; background: #0b1b2d; }
.sd-result[data-match=true] { background: #103936; border-color: #67b9a9; color: #dcfff1; }
.sd-hint summary, .sd-notes summary { color: #d6ebf7; font-weight: 660; cursor: pointer; padding-block: 7px; }
.sd-hint summary:focus-visible, .sd-notes summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.sd-hint p { padding-left: 13px; margin-bottom: 0; }
.sd-notes { margin-top: 18px; padding: 10px 16px; border-left: 3px solid #639db9; border-radius: 0 9px 9px 0; background: #102538; }
.sd-notes p { margin: 6px 0 10px; max-width: 96ch; }
.sd-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 920px) {
  .sd-workbench { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'observing' 'controls' 'challenge' 'plot'; gap: 14px; }
  .sd-frame { height: clamp(169px, 33vw, 250px); }
  .sd-plot-frame { height: clamp(196px, 31vw, 268px); }
}

@media (max-width: 560px) {
  .sd .lab-nav a { font-size: .78rem; padding-inline: 9px; }
  .sd h1 { font-size: clamp(2.2rem, 10.2vw, 2.85rem); }
  .sd h1 em { display: block; }
  .sd-frame { height: clamp(128px, 35vw, 185px); }
  .sd-observation { grid-template-columns: minmax(0, 1fr); }
  .sd-observation dt { font-size: .72rem; }
  .sd-observation dd { font-size: .88rem; }
}
