body {
  font-family: system-ui, sans-serif;
  margin: 0;
  padding: 16px;
  color: #1b1b1f;
  background: #fff;
}

main {
  display: block;
  max-width: 640px;
  margin: 0 auto;
}

form {
  display: grid;
  gap: 12px;
}

form > button,
form > img {
  justify-self: start;
}

output {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 12px;
  word-break: break-all;
  max-height: 8em;
  overflow: auto;
}

section {
  display: grid;
  gap: 12px;
  padding-block: 16px;
  border-top: 1px solid #e5e7eb;
}

section > h2,
section > p {
  margin: 0;
}

section > button,
.value > img {
  justify-self: start;
}

.value {
  display: grid;
  gap: 8px;
}

.value > img {
  max-width: 200px;
  border: 1px solid #ccc;
}

.toolbar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

dialog {
  width: min(560px, calc(100vw - 32px));
  box-sizing: border-box;
  display: grid;
  gap: 12px;
}

dialog:not([open]) {
  display: none;
}

dialog > h3 {
  margin: 0;
}

/* Custom styles recipe: custom properties and ::part() from the app's stylesheet. */
.fancy-signature {
  --dsf-height: 160px;
  --dsf-border: 2px solid #1a3fbf;
  --dsf-radius: 12px;
  --dsf-area-bg: #f8faff;
  --dsf-guide-color: #93a5e6;
  --dsf-button-color: #1a3fbf;
  --dsf-focus-ring: 3px solid #f59e0b;
}

.fancy-signature::part(ink) {
  filter: drop-shadow(0 1px 0 rgb(26 63 191 / 0.25));
}

.fancy-signature::part(action) {
  border-radius: 999px;
}

/* "← All demos": back to the GitHub Pages index (or the README's demo list when served at the root). */
.all-demos {
  display: inline-block;
  margin-bottom: 8px;
  color: #1d4ed8;
}

/* The page toggles previews and the submitted value with the `hidden` attribute. */
[hidden] {
  display: none !important;
}
