:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #172033;
  background: #f5f7fb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: radial-gradient(circle at top, rgba(79, 70, 229, 0.09), transparent 28rem), #f5f7fb;
  line-height: 1.55;
}

body > div {
  width: min(100% - 2rem, 68rem) !important;
  margin: 0 auto;
  padding: 3rem 0 5rem;
}

#env1code, #env2code, #env3code, #env4code, #env5code {
  display: block !important;
  width: 100%;
  margin: 0 0 2rem !important;
  padding: clamp(1rem, 3vw, 2rem);
  overflow: hidden;
  text-align: center !important;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #dfe3eb;
  border-radius: 1rem;
  box-shadow: 0 1rem 2.5rem rgba(23, 32, 51, 0.08);
}

h1 {
  margin: 0 0 0.75rem !important;
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  line-height: 1;
  letter-spacing: -0.05em;
}

h3 {
  margin: 0.5rem auto;
  color: #536078;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  font-weight: 600;
}

h3:last-of-type { margin-bottom: 2rem; }

a { color: #4338ca; }

#env1, #env2, #env3, #env4, #env5 {
  width: 100%;
  margin: 0 auto 1rem;
  padding-bottom: 0.35rem;
  overflow-x: auto;
  text-align: center;
  overscroll-behavior-inline: contain;
}

/* The library injects fixed-width block elements with an inline 10px margin.
   Auto side margins center them on wide screens and collapse safely when the
   simulation is wider than a mobile viewport. */
#env1 > *, #env2 > *, #env3 > *, #env4 > *, #env5 > * {
  margin-inline: auto !important;
}

button {
  min-height: 2.6rem;
  margin: 0.25rem;
  padding: 0.55rem 1rem;
  font: inherit;
  font-weight: 700;
  color: #fff;
  background: #4338ca;
  border: 0;
  border-radius: 0.6rem;
  cursor: pointer;
}

button:hover { background: #3730a3; }

button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(79, 70, 229, 0.35);
  outline-offset: 3px;
}

pre {
  width: 100%;
  max-width: 54rem;
  margin: 0 auto !important;
  padding: 1.25rem;
  overflow-x: auto;
  text-align: left !important;
  color: #e8edf7 !important;
  background: #182033 !important;
  border: 1px solid #2d3954;
  border-radius: 0.75rem;
  font: 0.875rem/1.65 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: pre;
  tab-size: 2;
}

input[type="range"] {
  max-width: min(18rem, 60vw);
  accent-color: #4338ca;
}

@media (max-width: 42rem) {
  body > div {
    width: min(100% - 1rem, 68rem) !important;
    padding-top: 1rem;
  }

  #env1code, #env2code, #env3code, #env4code, #env5code {
    padding: 1rem;
    border-radius: 0.75rem;
  }

  #env1, #env2, #env3, #env4, #env5 { text-align: left; }
  pre { font-size: 0.78rem; }
}
