.opt {
  --opt-inset: #081729;
  --opt-pad: clamp(14px, 1.7vw, 24px);
}

.opt .intro { padding-block: clamp(26px, 2.7vw, 40px) clamp(22px, 2vw, 32px); }

.opt-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.opt-heading {
  padding: 19px var(--opt-pad) 14px;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.opt-heading p, .opt-note, .opt-view-bar p, .opt-study-body, .opt-notes, .opt-texture-message {
  color: #bfd3e3;
  font-size: .85rem;
  line-height: 1.55;
}

.opt-heading p { margin: 5px 0 0; }

.opt-switch {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
  padding: 3px;
  border: 1px solid #38576e;
  border-radius: 10px;
  background: var(--opt-inset);
}

.opt-switch button {
  padding: 8px 11px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: #c7e0f0;
  background: transparent;
  font-size: .78rem;
  font-weight: 660;
  white-space: nowrap;
}

.opt-switch button[aria-pressed=true], .opt-presets button[aria-pressed=true] {
  background: #1d4960;
  color: #f1fcff;
  border-color: #64b3cb;
}

.opt-switch button:hover { border-color: #64b3cb; }

.opt-eyepieces {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(12px, 2.4vw, 36px);
  padding: 16px var(--opt-pad) 12px;
  margin-inline: 12px;
  background: radial-gradient(ellipse at 50% 22%, #172f46 0, #0a1b2d 72%);
  border: 1px solid #28475f;
  border-radius: 13px;
}

.opt-eye { min-width: 0; margin: 0; text-align: center; }

.opt-eye figcaption {
  display: flex;
  justify-content: center;
  align-items: baseline;
  flex-wrap: wrap;
  column-gap: .54rem;
  row-gap: 3px;
  margin-bottom: 13px;
  color: #c4d9e8;
  font-size: .79rem;
}

.opt-eye figcaption strong {
  color: #f2f8fd;
  font-size: 1.12rem;
  font-weight: 720;
  font-variant-numeric: tabular-nums;
}

.opt-active figcaption strong { color: #91e4ff; }

.opt-port {
  width: 100%;
  max-width: 370px;
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: #030910;
  overflow: hidden;
  isolation: isolate;
  box-shadow: 0 0 0 1px #658195, 0 0 0 5px #040d18, 0 0 0 6px #2d4c62, 0 9px 19px 6px #020913ab;
}

.opt-active .opt-port {
  box-shadow: 0 0 0 1px #75b8ce, 0 0 0 5px #06111b, 0 0 0 6px #426c84, 0 9px 20px 6px #020913ab;
}

.opt-port canvas, .opt-canvas canvas { display: block; width: 100%; height: 100%; }

.opt-image-reading {
  color: #c1d7e7;
  font-size: .76rem;
  line-height: 1.4;
  margin: 14px 0 0;
}

.opt-view-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 12px var(--opt-pad) 0;
}

.opt-view-bar p { margin: 0; }

.opt-readings {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid #315268;
  border-radius: 10px;
  background: var(--opt-inset);
  margin: 12px var(--opt-pad) 16px;
}

.opt-readings div { display: flex; flex-direction: column; padding: 10px clamp(8px, 1.55vw, 22px); }
.opt-readings div + div { border-left: 1px solid #315268; }
.opt-readings dt { color: #b6cddd; font-size: .77rem; line-height: 1.35; }
.opt-readings dt span { display: inline-block; }
.opt-readings dd {
  margin: auto 0 0;
  padding-top: 3px;
  color: #f2faff;
  font-size: clamp(1.22rem, 2.1vw, 1.68rem);
  letter-spacing: -.042em;
  font-weight: 690;
  font-variant-numeric: tabular-nums;
}

.opt-control-body, .opt-study-body { padding: 0 var(--opt-pad) 17px; }
.opt-controls { display: flex; flex-direction: column; align-self: stretch; }
.opt-control-body { display: flex; flex-direction: column; flex: 1; justify-content: space-between; }
.opt-controls .text-button { min-height: 44px; }
.opt-controls .slider-block + .slider-block { margin-top: 23px; }
.opt-controls .slider-block input { margin-top: 3px; }
.opt-controls .slider-ends { color: #aec6d7; }
.opt-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 24px; }
.opt-presets button { padding-inline: 7px; }

.opt-settings-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 23px;
  border-top: 1px solid #38566c;
  padding-top: 11px;
  gap: 2px 10px;
}

.opt-settings-foot p { margin: 0; color: #b7d0e1; font-size: .77rem; }

.opt-ray-stage, .opt-profile-stage {
  border-radius: 9px;
  border: 1px solid #35566e;
  background: var(--opt-inset);
  overflow: hidden;
}

.opt-ray-stage { height: clamp(184px, 18vw, 242px); margin: 0 var(--opt-pad); }
.opt-profile-stage { height: clamp(142px, 12vw, 176px); }

.opt-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  color: #c6dbe9;
  font-size: .76rem;
}

.opt-rays .opt-legend { margin-inline: var(--opt-pad); }
.opt-legend li { display: flex; align-items: center; gap: 7px; }
.opt-legend i { width: 17px; border-top: 2px solid #83deff; }
.opt-legend .opt-warm { border-top-color: #f1ba78; }
.opt-legend .opt-reference-line { border-top-color: #a6bad0; border-top-style: dashed; }
.opt-note { margin: 8px var(--opt-pad) 16px; }
.opt-study-body p { margin: 0 0 12px; }
.opt-study-body .opt-profile-reading { margin: 8px 0 0; color: #d2e6f2; }
.opt-study-body p:last-child { margin-bottom: 0; }
.opt-moon-data {
  margin: 0 0 12px;
  padding: 6px 11px;
  background: var(--opt-inset);
  border: 1px solid #35566e;
  border-radius: 9px;
}

.opt-moon-data div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 6px 0; }
.opt-moon-data div + div { border-top: 1px solid #35566e; }
.opt-moon-data dt { color: #bdd4e3; }
.opt-moon-data dd { margin: 0; color: #effaff; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.opt-texture-message { margin: 10px var(--opt-pad); }
.opt-notes { margin-top: 18px; padding: 12px 16px; border-left: 3px solid #5d9eb9; background: #102538; border-radius: 0 9px 9px 0; }
.opt-notes summary { color: #d5e9f6; font-weight: 670; cursor: pointer; padding-block: 6px; }
.opt-notes summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.opt-notes p { margin: 6px 0 10px; max-width: 96ch; }
.opt-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 930px) {
  .opt-workbench { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .opt-eyepieces { padding-inline: clamp(15px, 4vw, 34px); }
  .opt-ray-stage { height: clamp(184px, 29vw, 242px); }
}

@media (max-width: 540px) {
  .opt .lab-nav a { font-size: .78rem; padding-inline: 10px; }
  .opt h1 { font-size: clamp(2.2rem, 10.2vw, 2.85rem); }
  .opt h1 em { display: block; }
  .opt-observing .opt-heading { flex-direction: column; gap: 10px; }
  .opt-eyepieces { margin-inline: 9px; }
  .opt-eye figcaption { display: grid; margin-bottom: 10px; }
  .opt-eye figcaption strong { font-size: .97rem; }
  .opt-image-reading { font-size: .69rem; }
}
