* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: light;
}

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: flex;
  flex-direction: column;
  gap: 22px;
  padding: 28px 32px 40px;
}

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 0;
  max-width: 40em;
  font-size: 16px;
  line-height: 1.45;
  color: #3f3a34;
}

.soon {
  max-width: 36rem;
  padding: 28px 32px;
  border: 1px solid #1c1916;
  border-radius: 12px;
  background: #fffcf7;
}

.soon h2 {
  margin: 0 0 10px;
  font-family: "Noto Serif", "Liberation Serif", Georgia, serif;
  font-size: 32px;
  font-weight: 400;
  line-height: 1.1;
}

.soon p {
  margin: 0;
  max-width: 40em;
  font-size: 16px;
  line-height: 1.45;
  color: #3f3a34;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}

.controls, fieldset {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
  min-inline-size: 0;
  gap: 8px;
}

legend {
  padding: 0;
  font-size: 13px;
  color: #3f3a34;
}

.choices {
  display: grid;
  grid-auto-columns: 1fr;
  grid-auto-flow: column;
  width: 100%;
  border: 1px solid #1c1916;
  border-radius: 6px;
  overflow: hidden;
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  border: 0;
  border-right: 1px solid #1c1916;
  border-radius: 0;
  background: transparent;
  color: #1c1916;
  font-size: 15px;
  padding: 8px 10px;
  cursor: pointer;
  user-select: none;
  text-align: center;
}

.choice:last-child {
  border-right: 0;
}

.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  opacity: 0;
  cursor: pointer;
}

.choice input:focus,
.choice input:focus-visible {
  outline: none;
}

.choice:focus-within {
  outline: 2px solid #1c1916;
  outline-offset: -2px;
  z-index: 1;
}

.choice:has(input:checked):focus-within {
  outline-color: #fffcf7;
}

.choice:hover:not(:has(input:checked)) {
  background: #f3ece1;
}

.choice:has(input:checked) {
  background: #1c1916;
  color: #fffcf7;
}

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

.fine {
  color: #3f3a34;
}

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

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

.file-button {
  position: relative;
  display: inline-flex;
  width: auto;
  padding: 8px 12px;
  font-size: 14px;
}

.file-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
}

.file-button input:focus,
.file-button input:focus-visible {
  outline: none;
}

.file-button:focus-within,
button:focus-visible {
  outline: 2px solid #1c1916;
  outline-offset: 2px;
}

button:hover:not(:disabled),
.file-button:hover {
  background: #f3ece1;
}

button:disabled {
  cursor: default;
  opacity: 0.5;
}

.hint.error {
  color: #8a2e24;
}

#status {
  margin: 0;
  min-height: 1.4em;
  font-size: 14px;
  line-height: 1.4;
}

#status:empty {
  display: none;
}

#errors {
  display: grid;
  gap: 4px;
  flex: 1 0 100%;
}

#errors:empty {
  display: none;
}

.stage {
  position: relative;
  min-width: 0;
}

.stage:has(#empty:not([hidden])) {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 320px;
  padding: 32px 24px;
  border: 1.5px dashed #9c9286;
  border-radius: 12px;
  background: rgba(255, 252, 247, 0.4);
  text-align: center;
}

.stage:has(#empty:not([hidden])) #pickers {
  justify-content: center;
}

.stage:has(#empty:not([hidden])) .list,
.stage:has(#empty:not([hidden])) #errors {
  display: none;
}

.stage:has(#empty[hidden]) {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  align-content: flex-start;
  gap: 12px 16px;
}

.stage:has(#empty[hidden]) #type-note {
  display: none;
}

.stage.over,
.stage:has(#empty:not([hidden])).over {
  border: 1.5px solid #1c1916;
  border-radius: 12px;
  background: #fffcf7;
}

.empty {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  color: #1c1916;
}

.list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 0 100%;
}

.card {
  width: 200px;
  display: grid;
  gap: 8px;
}

.thumb {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 160px;
  border-radius: 8px;
  background-color: #efe8dc;
  background-image:
    linear-gradient(45deg, #d4cbbd 25%, transparent 25%),
    linear-gradient(-45deg, #d4cbbd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #d4cbbd 75%),
    linear-gradient(-45deg, transparent 75%, #d4cbbd 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
}

.thumb img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.name {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card button {
  justify-self: start;
  padding: 8px 12px;
  font-size: 14px;
}

@media (max-width: 800px) {
  main {
    padding: 24px 16px 32px;
  }

  h1 {
    font-size: 34px;
  }

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

  .stage {
    order: -1;
  }

  .stage:has(#empty:not([hidden])) {
    min-height: 240px;
  }

  .soon {
    padding: 22px 18px;
  }

  .soon h2 {
    font-size: 26px;
  }
}
