.chapter-upload {
  display: grid;
  grid-template-columns: minmax(220px, .72fr) minmax(600px, 1.28fr);
  background:
    radial-gradient(circle at 18% 24%, rgba(191, 154, 91, .18), transparent 26%),
    linear-gradient(118deg, #11100e 0 35%, #f5f0e7 35% 100%);
}

.upload-atmosphere {
  align-self: stretch;
  display: grid;
  align-content: center;
  gap: 1.15rem;
  padding: clamp(2rem, 5vw, 6rem);
  color: rgba(255, 255, 255, .52);
  font: 500 clamp(.65rem, 1vw, .82rem)/1.2 system-ui, sans-serif;
  letter-spacing: .32em;
}

.upload-atmosphere span {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.upload-atmosphere span::before {
  content: "";
  width: clamp(1.4rem, 3vw, 3.6rem);
  height: 1px;
  background: rgba(191, 154, 91, .7);
}

.upload-panel {
  width: min(780px, calc(100% - clamp(2rem, 8vw, 8rem)));
  max-height: calc(100vh - 10rem);
  margin: auto;
  padding: clamp(1.2rem, 2.3vw, 2rem) 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.upload-panel h2 {
  max-width: 760px;
  margin: .35rem 0 .55rem;
  color: #15130f;
  font: 400 clamp(2rem, 3.5vw, 4.4rem)/.96 Georgia, serif;
  letter-spacing: -.045em;
}

.upload-intro {
  max-width: 700px;
  margin: 0 0 1rem;
  color: #5f574b;
  font: 400 clamp(.83rem, 1vw, 1rem)/1.55 system-ui, sans-serif;
}

.upload-dropzone {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  padding: 1.1rem;
  border: 1px dashed rgba(34, 29, 22, .42);
  border-radius: 2px;
  background: rgba(255, 255, 255, .62);
  color: #28231c;
  cursor: pointer;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragging {
  border-color: #9b7437;
  background: rgba(255, 252, 246, .96);
  transform: translateY(-1px);
}

.upload-dropzone:focus-visible,
.upload-dropzone button:focus-visible,
.upload-file button:focus-visible,
.upload-file select:focus-visible,
.upload-failure-action button:focus-visible {
  outline: 3px solid #a77b34;
  outline-offset: 3px;
}

.upload-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border: 1px solid #af8950;
  border-radius: 50%;
  color: #835d25;
  font-size: 1.2rem;
}

.upload-dropzone strong,
.upload-dropzone span,
.upload-dropzone button,
.upload-rules,
.upload-summary,
.upload-guidance,
.upload-error,
.upload-failure-action {
  font-family: system-ui, sans-serif;
}

.upload-dropzone button,
.upload-failure-action button {
  border: 0;
  background: #191713;
  color: #fff;
  padding: .7rem 1rem;
  font-weight: 650;
  cursor: pointer;
}

.upload-rules {
  margin: .5rem 0 0;
  color: #71685b;
  font-size: .72rem;
  line-height: 1.45;
}

.upload-summary {
  display: flex;
  gap: 1.5rem;
  margin: .75rem 0;
  color: #4e473d;
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.upload-summary b {
  color: #1e1b16;
}

.upload-error,
.upload-file-error {
  color: #8e271d;
  font: 600 .76rem/1.4 system-ui, sans-serif;
}

.upload-error {
  margin: .65rem 0;
  padding: .65rem .75rem;
  border-left: 3px solid #a5392d;
  background: rgba(165, 57, 45, .08);
}

.upload-files {
  display: grid;
  gap: .5rem;
}

.upload-file {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(150px, .8fr) minmax(150px, .7fr);
  gap: .7rem 1rem;
  align-items: center;
  padding: .72rem .8rem;
  border: 1px solid rgba(47, 40, 31, .14);
  background: rgba(255, 255, 255, .66);
}

.upload-file.is-failed {
  border-color: rgba(165, 57, 45, .38);
}

.upload-file.is-review-required {
  border-color: rgba(155, 116, 55, .46);
}

.upload-file-head {
  min-width: 0;
  display: grid;
  gap: .12rem;
}

.upload-file-head strong {
  overflow: hidden;
  color: #242019;
  font: 650 .84rem/1.25 system-ui, sans-serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-file-head span,
.upload-file label,
.upload-file-status,
.upload-file-actions button {
  font-family: system-ui, sans-serif;
}

.upload-file-head span {
  color: #746b5f;
  font-size: .7rem;
}

.upload-file label {
  display: grid;
  gap: .22rem;
  color: #70665a;
  font-size: .63rem;
  font-weight: 650;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.upload-file select {
  min-width: 0;
  border: 1px solid rgba(45, 38, 29, .24);
  background: #fff;
  color: #2d2821;
  padding: .43rem .5rem;
  font-size: .73rem;
}

.upload-file-status {
  display: grid;
  gap: .3rem;
  color: #4d453a;
  font-size: .72rem;
  font-weight: 650;
}

.upload-file-status progress {
  width: 100%;
  height: 4px;
  border: 0;
  accent-color: #9b7437;
}

.upload-file-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}

.upload-file-actions button {
  border: 1px solid rgba(36, 31, 24, .25);
  background: transparent;
  color: #332d25;
  padding: .35rem .55rem;
  font-size: .68rem;
  font-weight: 650;
  cursor: pointer;
}

.upload-file-actions button.is-primary {
  background: #27221b;
  color: #fff;
}

.upload-file-error {
  grid-column: 1 / -1;
  margin: 0;
}

.upload-failure-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: .7rem;
  padding: .7rem .8rem;
  border: 1px solid rgba(165, 57, 45, .25);
  background: rgba(165, 57, 45, .06);
}

.upload-failure-action[hidden] {
  display: none;
}

.upload-failure-action p {
  margin: 0;
  color: #65574d;
  font-size: .74rem;
  line-height: 1.4;
}

.upload-failure-action button {
  flex: 0 0 auto;
  font-size: .7rem;
}

.upload-guidance {
  margin: .72rem 0 0;
  color: #675d50;
  font-size: .73rem;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .chapter-upload {
    grid-template-columns: 1fr;
    background: #f5f0e7;
  }

  .upload-atmosphere {
    display: none;
  }

  .upload-panel {
    width: min(760px, calc(100% - 2rem));
    max-height: calc(100vh - 8.5rem);
    padding: 1.4rem 0 2rem;
  }
}

@media (max-width: 620px) {
  .upload-panel {
    width: calc(100% - 1.25rem);
    max-height: calc(100vh - 7.4rem);
    padding-top: .9rem;
  }

  .upload-panel h2 {
    font-size: clamp(1.72rem, 9vw, 2.55rem);
  }

  .upload-intro {
    font-size: .78rem;
  }

  .upload-dropzone {
    min-height: 104px;
    flex-wrap: wrap;
    gap: .45rem .65rem;
  }

  .upload-summary {
    justify-content: space-between;
    gap: .6rem;
    font-size: .65rem;
  }

  .upload-file {
    grid-template-columns: minmax(0, 1fr) minmax(120px, .72fr);
    gap: .55rem;
  }

  .upload-file-status {
    grid-column: 1 / -1;
  }

  .upload-failure-action {
    align-items: stretch;
    flex-direction: column;
  }
}
