body:has(.neo-demo-title) { padding: clamp(1rem, 4.5vw, 4rem); }
main:has(> .neo-demo-title) { max-width: 64rem; }
main:has(> .neo-demo-title) > p { margin-bottom: clamp(1.75rem, 4vw, 3.75rem); }
.neo-demo-title { margin: 0 0 .45em; font: 680 clamp(2.5rem, 5.6vw, 5rem)/1 Inter, "Helvetica Neue", Arial, sans-serif; letter-spacing: -.065em; }
.sample-bed:has(.neo-demo), .sample-content:has(> .neo-demo) { display: block; max-width: none; padding: 0; border: 0; box-shadow: none; }
.neo-demo {
  --neo-demo-stage: #f4f4f3;
  --neo-demo-grid: #dededc;
  --neo-demo-panel: #fff;
  --neo-demo-text: #171717;
  --neo-demo-muted: #575757;
  --neo-demo-line: #bdbdbb;
  container-type: inline-size;
  min-width: 0;
  overflow: hidden;
  color: var(--neo-demo-text);
  background: var(--neo-demo-panel);
  font: 500 .85rem/1.4 Inter, "Helvetica Neue", Arial, sans-serif;
}
html[data-theme="dark"] .neo-demo {
  --neo-demo-stage: #313131;
  --neo-demo-grid: #393939;
  --neo-demo-panel: #202020;
  --neo-demo-text: #f2f2f2;
  --neo-demo-muted: #c4c4c4;
  --neo-demo-line: #767676;
  color-scheme: dark;
}
main > .neo-demo { border: 1px solid var(--neo-demo-line); border-radius: .65rem; }
.neo-demo-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(17rem, 39vh, 25rem);
  padding: 2.5rem 1.25rem;
  box-sizing: border-box;
  background:
    linear-gradient(90deg, var(--neo-demo-grid) 1px, transparent 1px) center / 28px 28px,
    linear-gradient(var(--neo-demo-grid) 1px, transparent 1px) center / 28px 28px,
    var(--neo-demo-stage);
}
.neo-demo-stage::before {
  content: "";
  position: absolute;
  inset: 1rem;
  pointer-events: none;
  background:
    linear-gradient(currentColor,currentColor) top left / 10px 1px,
    linear-gradient(currentColor,currentColor) top left / 1px 10px,
    linear-gradient(currentColor,currentColor) bottom right / 10px 1px,
    linear-gradient(currentColor,currentColor) bottom right / 1px 10px;
  background-repeat: no-repeat;
  color: var(--neo-demo-muted);
}
.neo-demo-tools {
  display: grid;
  grid-template-columns: 1fr 1.38fr .9fr 1fr;
  margin: 0;
  padding: 1.05rem 1.2rem 1.2rem;
  gap: 1rem;
  border-top: 1px solid var(--neo-demo-line);
}
.neo-demo-tools[hidden] { display: none; }
.neo-demo-field, .neo-demo-caption { display: block; min-width: 0; padding: 0; margin: 0; border: 0; }
.neo-demo-caption { margin-bottom: .5rem; font: 600 .69rem/1.2 ui-monospace, monospace; letter-spacing: .075em; text-transform: uppercase; color: var(--neo-demo-muted); }
.neo-demo-tools select, .neo-demo-colors input, .neo-demo-shapes {
  box-sizing: border-box;
  min-width: 0;
  height: 2.35rem;
  margin: 0;
  border: 1px solid var(--neo-demo-line);
  border-radius: .25rem;
  background: var(--neo-demo-panel);
  color: var(--neo-demo-text);
}
.neo-demo-tools select { width: 100%; padding: 0 .35rem; cursor: pointer; font: inherit; }
.neo-demo-colors { display: grid; grid-template-columns: 2.35rem 1fr; gap: .3rem; }
.neo-demo-colors input { width: 100%; padding: .17rem; cursor: pointer; }
.neo-demo-colors input::-webkit-color-swatch-wrapper { padding: 2px; }
.neo-demo-shapes { display: flex; align-items: stretch; padding: 2px; gap: 1px; }
.neo-demo-shapes label { position: relative; flex: 1; cursor: pointer; }
.neo-demo-shapes input { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); }
.neo-demo-shapes span { display: grid; place-items: center; height: 100%; padding: 0 .3rem; font-size: .78rem; border-radius: .13rem; }
.neo-demo-shapes input:checked + span { background: var(--neo-demo-text); color: var(--neo-demo-panel); }
.neo-demo-size-label { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: .5rem; }
.neo-demo-size-label .neo-demo-caption { margin: 0; }
.neo-demo-size-label output { font: 500 .69rem/1.2 ui-monospace, monospace; }
.neo-demo-tools input[type="range"] { display: block; width: 100%; height: 2.35rem; margin: 0; accent-color: var(--neo-demo-text); cursor: pointer; }
.neo-demo-tools :is(select, input:not([type="radio"])):focus-visible,
.neo-demo-shapes input:focus-visible + span { outline: 2px solid var(--neo-demo-text); outline-offset: 2px; }
@container (max-width: 42rem) {
  .neo-demo-tools { grid-template-columns: 1fr 1.35fr; }
}
@container (max-width: 21rem) {
  .neo-demo-tools { grid-template-columns: 1fr; }
}
@media (forced-colors: active) {
  .neo-demo-shapes input:checked + span { outline: 2px solid Highlight; outline-offset: -2px; }
}
