* {
  box-sizing: border-box;
}

body {
  margin: 4em;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu",
    "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif, Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::-webkit-scrollbar {
  display: none;
}

span p {
  display: inline;
}

input, button {
  margin: 6px 0;
  padding: 5px;
  width: 100%;
  max-width: 150px;
}

input[type="color"] {
  width: 100%;
  max-width:40px;
  padding: 0;
  border: none;
  background: none;
  vertical-align: middle;
}

.main-layout {
  display: flex;
  align-items: stretch;
  gap: 32px;
}

.main-layout > div {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.main-layout > div:first-child {
  min-width: 400px;
  flex: 1 1 0;
}

.signature-preview-column {
  min-width: 425px;
  flex: 2 1 0;
  max-width: 1200px;
}

#signature {
  width: 650px;
  max-width: 100%;
  max-height: 100%;    /* Adjust this value as needed */
  overflow-y: auto;
  overflow-x: auto;
  box-sizing: border-box;
  padding: 8px;
  background: #fff;     /* Optional: for contrast */
  border: 1px solid #ccc; /* Optional: for clarity */
}

textarea {
  width: 100%;
  height: 200px;
  margin-top: 10px;
}

.form-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px 24px;
  max-width: 650px;
  margin-bottom: 2em;
}

.form-fields label {
  grid-column: span 1;
  align-self: center;
}

.form-fields input,
.form-fields select,
.form-fields button {
  grid-column: span 2;
  width: 100%;
  max-width: 100%;
}

.form-fields fieldset,
.signature-preview-column fieldset {
  flex: 1 1 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

h1,
legend,
label,
.form-fields select,
.form-fields button,
fieldset {
  color: #6264A7;
  border-color: #6264A7;
}

