body {
  font-family: system-ui, sans-serif;
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.picker {
  margin-bottom: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.picker select {
  margin-right: 1rem;
}

.layout {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

/* Vertical badges are narrow; horizontal ones get more room. */
.layout.vertical .preview {
  flex: 0 1 380px;
}

.layout.horizontal .preview {
  flex: 0 1 620px;
}

.preview img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #f4f4f4;
}

.fields {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fields label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.fields input {
  padding: 0.4rem;
  font-size: 1rem;
}

.fields button {
  padding: 0.6rem;
  font-size: 1rem;
  cursor: pointer;
}

.warning {
  color: #b7791f;
  margin: 0.5rem 0 0;
}

.error {
  color: #c53030;
  margin: 0;
}

/* Phones: preview on top, form below it spanning the full width. */
@media (max-width: 700px) {
  .layout {
    flex-direction: column;
    align-items: stretch;
    gap: 1.5rem;
  }

  /* Must be as specific as the desktop .layout.<orientation> rules, or their
     flex-basis turns into a fixed height once the layout is a column. */
  .layout.vertical .preview,
  .layout.horizontal .preview {
    flex: none;
    width: 100%;
  }

  /* Keep tall vertical badges from pushing the form off-screen. */
  .layout.vertical .preview {
    max-width: 360px;
    margin: 0 auto;
  }

  .fields {
    flex: none;
    width: 100%;
  }

  .fields input,
  .fields button {
    width: 100%;
    box-sizing: border-box;
  }

  .fields button {
    padding: 0.8rem;
  }
}
