:root {
  --paper: #eeede7;
  --card: #fffefb;
  --ink: #1a1a18;
  --muted: #74705f;
  --line: #d7d2c4;
  --line-soft: #e4e0d3;
  --transit: #2f5d62;
  --transit-soft: #e3edee;
  --success: #3f7d4a;
  --success-soft: #e6f0e5;
  --fail: #a63a2a;
  --fail-soft: #f5e6e2;
  --queued: #9a9584;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(26,26,24,0.04), 0 8px 24px -12px rgba(26,26,24,0.18);
}

* { box-sizing: border-box; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
  background-image: linear-gradient(var(--line-soft) 1px, transparent 1px);
  background-size: 100% 2.1rem;
  color: var(--ink);
  font-family: 'Inter', system-ui, sans-serif;
}

body {
  display: flex;
  justify-content: center;
  padding: 6vh 20px;
}

.sheet {
  width: 100%;
  max-width: 640px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px 32px 20px;
}

.sheet__head {
  padding-bottom: 24px;
  border-bottom: 1px dashed var(--line);
  margin-bottom: 24px;
}

.brand { display: flex; gap: 12px; align-items: flex-start; }

.brand__mark {
  font-size: 22px;
  line-height: 1;
  margin-top: 3px;
  color: var(--transit);
}

.brand h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 4px;
}

.brand__sub {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  max-width: 44ch;
  line-height: 1.5;
}

.btn {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  border-radius: 7px;
  padding: 9px 14px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn--text {
  background: transparent;
  color: var(--muted);
  padding: 6px 8px;
}
.btn--text:hover { color: var(--ink); }

.btn--retry {
  background: var(--fail-soft);
  color: var(--fail);
  border-color: transparent;
  padding: 6px 12px;
  font-size: 12px;
}
.btn--retry:hover { background: #efd8d1; }

.hidden { display: none !important; }

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-align: center;
  padding: 34px 20px;
  border: 1.5px dashed var(--line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--muted);
  background: repeating-linear-gradient(135deg, transparent, transparent 10px, var(--line-soft) 10px, var(--line-soft) 11px);
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.dropzone strong {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 15px;
  color: var(--ink);
}
.dropzone span { font-size: 12.5px; }
.dropzone:hover, .dropzone.is-dragover {
  border-color: var(--transit);
  color: var(--transit);
}
.dropzone.is-dragover { background-color: var(--transit-soft); }

.summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--muted);
}
#summaryText { font-family: 'JetBrains Mono', monospace; letter-spacing: -0.01em; }
.summary__actions { display: flex; gap: 4px; }

.row__note {
  grid-column: 1 / -1;
  font-size: 11.5px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

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

.row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 10px 14px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line-soft);
}
.row:last-child { border-bottom: none; }

.row__info { min-width: 0; }

.row__name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.row__size { font-family: 'JetBrains Mono', monospace; }

.row__error {
  grid-column: 1 / -1;
  font-size: 12px;
  color: var(--fail);
  background: var(--fail-soft);
  border-radius: 6px;
  padding: 7px 10px;
  margin-top: 2px;
  line-height: 1.4;
}

.progress {
  height: 3px;
  background: var(--line-soft);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.progress__bar {
  height: 100%;
  background: var(--transit);
  width: 0%;
  transition: width 0.2s ease;
}

.stamp {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 4px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
  transform: rotate(-2deg);
}

.stamp--queued { color: var(--queued); border-style: dashed; }
.stamp--uploading { color: var(--transit); background: var(--transit-soft); animation: pulse 1.4s ease-in-out infinite; }
.stamp--success { color: var(--success); background: var(--success-soft); animation: land 0.32s cubic-bezier(.2,1.4,.4,1); }
.stamp--failed { color: var(--fail); background: var(--fail-soft); animation: land 0.32s cubic-bezier(.2,1.4,.4,1); }

@keyframes land {
  0% { transform: rotate(-2deg) scale(1.5); opacity: 0; }
  60% { transform: rotate(-2deg) scale(0.94); opacity: 1; }
  100% { transform: rotate(-2deg) scale(1); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.sheet__foot {
  display: block;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

:focus-visible {
  outline: 2px solid var(--transit);
  outline-offset: 2px;
}

@media (max-width: 480px) {
  .sheet { padding: 24px 18px 16px; }
  .row { grid-template-columns: 1fr auto; }
}
