* {
  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, 460px) 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, .drop {
  display: grid;
  gap: 14px;
}

.drop {
  gap: 10px;
  padding: 16px;
  border: 1px dashed #c9c0b2;
  border-radius: 6px;
  background: #fffcf7;
}

.drop.over {
  border-style: solid;
  border-color: #1c1916;
}

.drop-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #3f3a34;
}

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

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

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

.fine {
  margin-top: 2px;
}

.empty {
  margin-top: 18px;
  font-size: 15px;
  line-height: 1.45;
}

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

button, .file-button {
  justify-self: start;
  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 {
  outline: none;
}

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

button.linkish {
  border: 0;
  background: transparent;
  padding: 0;
  font-size: 14px;
  text-decoration: underline;
}

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

button.linkish:hover:not(:disabled) {
  background: transparent;
  color: #34302b;
}

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

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

.hint.error, #status.error, .meta.error {
  color: #8a2e24;
}

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

.stage {
  display: flex;
  justify-content: center;
}

.sheet {
  width: min(100%, 720px);
  min-height: 280px;
  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;
}

.list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px 14px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.card img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 160px;
  aspect-ratio: 1;
  object-fit: fill;
  background: #fff;
  border: 1px solid #e4dcd0;
}

.out-name, .meta, .from {
  margin: 0;
  overflow-wrap: anywhere;
}

.out-name {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.3;
}

.meta, .from {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.35;
  color: #6a6258;
}

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

@media (min-width: 861px) {
  .stage {
    position: sticky;
    top: 24px;
  }
}

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

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