:root {
  --paper: #f3ebe0;
  --ink: #241c16;
  --muted: #6b5c50;
  --line: #d8cbb8;
  --card: #fffaf2;
  --seal: #8c2f14;
  --seal-deep: #6d220e;
  --ok: #2f5d3a;
  --shadow: 0 18px 50px rgba(48, 32, 18, 0.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: Outfit, "Segoe UI", sans-serif;
  font-weight: 380;
}

body {
  position: relative;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.18;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.wrap {
  width: min(580px, 92vw);
  margin: 72px auto 80px;
}

h1 {
  margin: 0 0 14px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.7rem;
  font-weight: 520;
}

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 28px 26px 24px;
}

.panel-head h2 {
  margin: 0 0 4px;
  font-family: Fraunces, Georgia, serif;
  font-size: 1.45rem;
  font-weight: 520;
}

.panel-head p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.92rem;
}

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 168px;
  padding: 22px;
  border: 1.5px dashed #c7b59b;
  background: #fbf6ee;
  color: var(--muted);
  cursor: pointer;
  text-align: center;
}

.drop strong {
  color: var(--ink);
  font-weight: 500;
}

.drop input {
  display: none;
}

.drop.over {
  border-color: var(--seal);
  background: #fff4ea;
}

.drop-icon {
  color: var(--seal);
  margin-bottom: 6px;
}

.file-list {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
}

.file-list li {
  padding: 12px 0 14px;
  border-bottom: 1px solid #eee4d6;
  font-size: 0.92rem;
}

.file-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.file-list button {
  border: 0;
  background: none;
  color: var(--seal);
  cursor: pointer;
  font: inherit;
}

.file-opts {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
  margin: 12px 0 4px;
}

fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  padding: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.file-opts label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
  cursor: pointer;
}

button[type="submit"] {
  width: 100%;
  margin-top: 18px;
  border: 0;
  background: var(--seal);
  color: #fffaf2;
  padding: 14px 16px;
  font: inherit;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
}

button[type="submit"]:hover:not(:disabled) {
  background: var(--seal-deep);
}

button[type="submit"]:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.status {
  min-height: 1.4em;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.status.error { color: var(--seal); }
.status.ok { color: var(--ok); }

@media (max-width: 860px) {
  .wrap {
    margin-top: 36px;
  }

  .file-opts {
    grid-template-columns: 1fr;
  }
}
