:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #192e43;
  background: #f2f5f8;
}

* { box-sizing: border-box; }
body { margin: 0; }
main { max-width: 960px; margin: 0 auto; padding: 48px 24px; }
a { color: #174f77; }
.eyebrow { font-size: .78rem; letter-spacing: .13em; text-transform: uppercase; color: #536b82; }
.eyebrow a { color: inherit; }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); letter-spacing: -.03em; margin: 12px 0; line-height: 1.12; }
.intro { font-size: 1.1rem; color: #536b82; max-width: 66ch; }
p, footer { line-height: 1.6; }
.panel { margin-top: 24px; padding: 24px 28px; background: white; border: 1px solid #d7e1ea; border-radius: 14px; }
h2 { margin: 0 0 16px; font-size: 1.2rem; }
.viewer { display: grid; gap: 18px 20px; align-items: start; }
.sky { min-width: 0; }
.sky-frame { position: relative; background: #000; border-radius: 6px; overflow: hidden; }
#plot { display: block; width: 100%; height: auto; aspect-ratio: 740 / 540; }
.loading { position: absolute; inset: 0; display: grid; place-content: center; color: #e0eaf3; }
.facts { margin: 12px 0 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.facts dt { color: #536b82; font-size: .78rem; }
.facts dd { margin: 3px 0 0; font-size: .90rem; font-weight: 600; font-variant-numeric: tabular-nums; }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.controls { min-width: 0; }
.field { display: grid; gap: 5px; margin-bottom: 12px; min-width: 0; font-weight: 600; font-size: .9rem; }
input, select {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-weight: 400;
  color: #192e43;
  padding: 7px 9px;
  border: 1px solid #b9c8d6;
  border-radius: 6px;
  background: white;
}
input:disabled, select:disabled { background: #f2f5f8; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 16px; }
button {
  font: inherit;
  padding: 9px 15px;
  border-radius: 7px;
  border: 1px solid #174f77;
  background: #174f77;
  color: white;
  cursor: pointer;
}
button:hover:not(:disabled) { filter: brightness(.93); }
button:disabled { opacity: .45; cursor: not-allowed; }
.secondary { background: white; color: #174f77; }
:focus-visible { outline: 3px solid #e7a840; outline-offset: 3px; }
.hint, footer { color: #536b82; font-size: .88rem; }
.actions button { padding-inline: 11px; }
#status { margin: 12px 0 0; }
#error { color: #9a2323; font-size: .9rem; font-weight: 600; }
footer { margin-top: 28px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (min-width: 720px) {
  .viewer { grid-template-columns: minmax(0, 1fr) 235px; }
}
@media (max-width: 600px) {
  main { padding: 24px 16px; }
  .panel { padding: 18px; }
}

.plot-legend { display: flex; flex-wrap: wrap; gap: 16px; padding: 0; list-style: none; font-size: .88rem; }
.plot-legend li { display: flex; align-items: center; gap: 6px; }
.swatch { width: 10px; height: 10px; border: 1px solid #536b82; border-radius: 50%; }

.curve { background: #79baff; }
.rectangles { background: #f5c65e; }
.trapezoids { background: #ff7777; }
.full-width { grid-column: 1 / -1; }
.formula { margin: 0 0 12px; font-size: 1.1rem; font-weight: 600; }
