.applet-index-lead,
.applet-card-grid,
.applet-nav,
main.content > p,
main.content > .applet-stage,
main.content > .applet-note {
  width: min(1500px, calc(100% - 2rem));
  margin-right: auto;
  margin-left: auto;
}

.applet-index-lead {
  max-width: 1080px;
  margin-bottom: 1.4rem;
  color: #53616f;
  font-size: 1.05rem;
  line-height: 1.6;
}

.applet-index-lead p {
  max-width: 780px;
}

.applet-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 0.9rem;
  max-width: 1180px;
  padding-bottom: 3rem;
}

.applet-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 1.15rem;
  border: 1px solid rgba(43, 67, 91, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 28px rgba(43, 67, 91, 0.07);
}

.applet-card--featured {
  border-color: rgba(31, 111, 139, 0.45);
  background: linear-gradient(145deg, #f2fbff, #ffffff 60%);
  box-shadow: 0 14px 34px rgba(31, 111, 139, 0.13);
}

.applet-card-kicker {
  color: #1f6f8b;
  font-size: 0.74rem;
  font-weight: 780;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

.applet-card h2 {
  margin: 0.38rem 0 0.55rem;
  font-size: 1.23rem;
  line-height: 1.2;
}

.applet-card h2 a {
  color: #25313a;
  text-decoration: none;
}

.applet-card h2 a:hover {
  color: #175873;
}

.applet-card p {
  margin: 0;
  color: #53616f;
  line-height: 1.48;
}

.applet-card-action {
  margin-top: auto;
  padding-top: 1rem;
  color: #175873;
  font-weight: 720;
  text-decoration: none;
}

.applet-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.applet-nav a {
  color: #175873;
  font-weight: 700;
  text-decoration: none;
}

.applet-stage {
  box-sizing: border-box;
  margin-top: 1.2rem;
  margin-bottom: 1.2rem;
  padding: clamp(0.55rem, 1.7vw, 1.5rem);
  overflow: auto;
  border: 1px solid rgba(103, 151, 184, 0.34);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0, rgba(34, 93, 134, 0.28), transparent 44%),
    #06111f;
  color: #f0f5fa;
  box-shadow: 0 18px 44px rgba(17, 38, 56, 0.16);
}

.applet-stage--large {
  max-width: 1560px;
}

.applet-stage--reveal {
  font-size: 34px;
}

.applet-stage--reveal-scale {
  font-size: 42px;
}

.applet-stage .observablehq {
  max-width: 100%;
}

.applet-note {
  margin-bottom: 3rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid #1f6f8b;
  background: rgba(255, 255, 255, 0.72);
  color: #53616f;
  line-height: 1.55;
}

.spectrum-widget input[type="range"] {
  width: 100% !important;
  border: 0 !important;
  background: transparent !important;
  accent-color: #ffb347;
}

.spectrum-widget label,
.spectrum-widget .observablehq {
  color: #fff !important;
}

.spectrum-widget .observablehq--inspect {
  display: none !important;
}

.resolved-spectrum-widget .resolved-mass-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  align-items: center;
  width: 100%;
}

.resolved-spectrum-widget .resolved-mass-controls label {
  display: grid;
  grid-template-columns: auto 3.2rem minmax(5rem, 1fr);
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}

.resolved-spectrum-widget .resolved-mass-controls output,
.fermi-compare-widget .fermi-compare-controls output {
  box-sizing: border-box;
  min-width: 3.2rem;
  padding: 0.18rem 0.28rem;
  border: 1px solid #999;
  background: #f2f2f2;
  color: #111;
  text-align: center;
}

.spectrum-widget .spectrum-panel {
  display: flex;
  width: 100%;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.spectrum-widget .spectrum-plot-host {
  width: 100%;
  background: #fff !important;
  line-height: 1;
}

.spectrum-widget .spectrum-plot-host svg {
  display: block;
  width: 100% !important;
  max-width: none !important;
  height: auto !important;
  background: #fff !important;
  color: #111 !important;
}

@media (max-width: 800px) {
  .applet-card-grid {
    grid-template-columns: 1fr;
  }

  .applet-stage--reveal {
    min-width: 940px;
  }

  .applet-stage--reveal-scale {
    font-size: 34px;
  }

  .applet-stage--reveal-scale .loss-cone-lab {
    min-width: 760px;
  }

  .applet-stage--reveal-scale .loss-cone-lab-intro {
    grid-template-columns: 1fr 1fr;
  }

  .resolved-spectrum-widget .resolved-mass-controls {
    grid-template-columns: 1fr;
  }
}
