* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background: #e6e0d4;
  color: #1c1916;
  font-family: Inter, "Noto Sans", "Liberation Sans", sans-serif;
  font-synthesis: none;
}

main {
  display: grid;
  grid-template-columns: minmax(300px, 480px) minmax(280px, 1fr);
  gap: 36px;
  align-items: start;
  min-height: 100vh;
  padding: 32px 40px 48px;
}

.mark {
  margin: 0 0 12px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5e574e;
}

h1 {
  margin: 0;
  font-family: "Noto Serif", "Liberation Serif", Georgia, serif;
  font-size: 42px;
  font-weight: 400;
  line-height: 1.1;
}

.lede {
  margin: 12px 0 22px;
  max-width: 38em;
  font-size: 16px;
  line-height: 1.45;
  color: #3f3a34;
}

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

.field-label,
label {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 13px;
  color: #3f3a34;
}

.field-label {
  display: block;
}

input,
textarea {
  width: 100%;
  border: 1px solid #c9c0b2;
  border-radius: 6px;
  background: #fffcf7;
  color: #1c1916;
  font: inherit;
  font-size: 16px;
  padding: 10px 12px;
}

textarea {
  font-size: 15px;
  resize: vertical;
  min-height: 108px;
  line-height: 1.4;
}

input[type="color"] {
  height: 42px;
  padding: 6px;
}

.picks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hint, .fine {
  margin: 0;
  max-width: 46em;
  font-size: 13px;
  line-height: 1.4;
  color: #5e574e;
}

.hint.error {
  color: #8a2e24;
  min-height: 1.2em;
}

button, .choice {
  justify-self: start;
  border: 1px solid #1c1916;
  border-radius: 6px;
  background: transparent;
  color: #1c1916;
  font: inherit;
  font-size: 15px;
  padding: 10px 16px;
  cursor: pointer;
}

.choice {
  font-size: 14px;
  padding: 8px 12px;
}

.choice[aria-pressed="true"] {
  background: #1c1916;
  color: #fffcf7;
}

button:hover:not(:disabled):not(.choice),
.choice:hover:not([aria-pressed="true"]) {
  background: #f3ece1;
}

.choice[aria-pressed="true"]:hover {
  background: #1c1916;
  color: #fffcf7;
}

button:disabled,
input:disabled {
  cursor: default;
  opacity: 0.45;
}

:focus-visible {
  outline: 2px solid #1c1916;
  outline-offset: 2px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
}

.stage {
  display: grid;
  gap: 22px;
}

.sheet {
  width: min(100%, 720px);
  padding: 22px 22px 26px;
  background: #fffcf7;
  box-shadow: 0 12px 32px rgba(48, 38, 22, 0.12);
}

.sheet-label {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6a6258;
}

#preview {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 150px;
  padding-top: 16px;
}

#preview svg {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
}

.paper {
  width: min(100%, 540px);
  margin-top: 16px;
  aspect-ratio: 8.5 / 11;
  background: #fffcf7;
  border: 1px solid #e4dcd0;
  padding: 5%;
  display: grid;
  grid-template-columns: repeat(var(--cols, 2), minmax(0, 1fr));
  grid-template-rows: repeat(var(--rows, 8), minmax(0, 1fr));
  gap: 8px;
}

.cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.cell svg {
  width: 100%;
  height: 100%;
}

#sheet-note {
  margin-top: 12px;
}

noscript {
  display: block;
  padding: 16px 20px;
  background: #fff4e8;
}

@media (max-width: 860px) {
  main {
    grid-template-columns: 1fr;
    padding: 24px 18px 40px;
  }

  h1 {
    font-size: 34px;
  }

  .picks {
    grid-template-columns: 1fr 1fr;
  }
}
