:root {
  color-scheme: dark;
  --canvas: #393838;
  --ink: #fbf9ff;
  --muted: #dedbec;
  --edge: #ece8ff;
  --lavender: #b7aff5;
  --violet: #5141c3;
  --indigo: #302295;
  --focus: #d1c8ff;
  --control-accent: #b4a7ff;
  font: 100% / 1.5 ui-rounded, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

body,
fieldset,
figure,
pre,
ul,
.tooltip {
  margin: 0;
}

body {
  color: var(--ink);
  background: var(--canvas);
}

main,
.center-inline {
  margin-inline: auto;
}

main {
  display: grid;
  align-content: center;
  width: min(920px, calc(100% - 32px));
  min-height: 100svh;
  padding-block: clamp(8px, 2vw, 32px);
}

:focus-visible,
.choice input:focus-visible + label {
  outline: 2px solid var(--focus);
  outline-offset: 4px;
}

code {
  font-family: ui-monospace, monospace;
}

.controls,
figcaption,
nav a,
summary,
.tooltip,
.callout .label {
  font-weight: bold;
}

figcaption {
  text-align: center;
}

.controls,
.flex-wrap-center {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.controls {
  gap: 12px 24px;
  margin-block-end: clamp(16px, 4vw, 32px);

  label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
  }

  input {
    margin: 0;
    accent-color: var(--control-accent);
  }

  input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
  }
}

fieldset {
  min-inline-size: 0;
  padding: 0;
  border: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
}

.choice {
  position: relative;
  display: inline-grid;

  input {
    position: absolute;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
  }
}

/* 対応環境でだけ作例を表示する */
.unsupported {
  display: none;
}

@supports not (border-shape: shape(from 0 0, line to 100% 100%, close)) {
  .supported-content {
    display: none;
  }

  .unsupported {
    display: block;
    padding: 20px;
    border: 1px solid var(--lavender);
    border-radius: 12px;
  }
}
