:root {
  color-scheme: light;
  --ink: #553a31;
  --muted: #725d55;
  --accent: #b86e4d;
  --accent-dark: #925338;
  --paper: #fffaf6;
  --blush: #fbe4d7;
  --line: #efd8ca;
  --success: #39734c;
  --danger: #a33b32;
  --shadow: 0 18px 50px rgba(73, 44, 35, .11);
}

* { box-sizing: border-box; }

html { background: #fff6ef; }

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(251, 228, 215, .9), transparent 34rem),
    linear-gradient(180deg, #fffaf6, #fff3eb);
  color: var(--muted);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
  margin: 0;
  min-height: 100vh;
}

button, input { font: inherit; }

button, label[for] { -webkit-tap-highlight-color: transparent; }

button:focus-visible,
input:focus-visible,
.upload-file-button:focus-within,
a:focus-visible {
  outline: 3px solid rgba(184, 110, 77, .35);
  outline-offset: 3px;
}

.upload-header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin: 0 auto;
  max-width: 860px;
  padding: 22px 24px;
}

.upload-header__brand {
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 700;
  text-decoration: none;
}

.upload-header__brand span { color: var(--accent); }

.upload-header p {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  margin: 0;
  text-transform: uppercase;
}

.upload-shell {
  margin: 0 auto;
  max-width: 760px;
  padding: 40px 20px 80px;
}

.upload-hero {
  margin: 0 auto 35px;
  max-width: 650px;
  text-align: center;
}

.upload-eyebrow,
.upload-step {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.upload-hero h1 {
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(38px, 8vw, 64px);
  line-height: 1.05;
  margin: 0 0 18px;
}

.upload-hero p:last-child {
  font-size: 18px;
  margin: 0;
}

.upload-card,
.upload-notice,
.upload-privacy {
  background: rgba(255, 255, 255, .9);
  border: 1px solid rgba(239, 216, 202, .9);
  border-radius: 20px;
  box-shadow: var(--shadow);
  margin-top: 22px;
  padding: clamp(22px, 5vw, 36px);
}

.upload-notice {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: center;
  text-align: center;
}

.upload-card h2,
.upload-privacy h2 {
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(25px, 5vw, 32px);
  line-height: 1.18;
  margin: 0 0 12px;
}

.upload-card__heading {
  align-items: flex-start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.upload-card__heading h2 { margin: 0; }

.upload-card label:not(.upload-consent):not(.upload-file-button) {
  color: var(--ink);
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin: 22px 0 7px;
}

.upload-card label span { color: var(--muted); font-weight: 400; }

.upload-card input[type='text'],
.upload-card input[type='email'] {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  min-height: 48px;
  padding: 11px 13px;
  width: 100%;
}

.upload-consent {
  align-items: flex-start;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 11px;
  margin-top: 24px;
}

.upload-consent input {
  accent-color: var(--accent);
  flex: 0 0 auto;
  height: 20px;
  margin-top: 2px;
  width: 20px;
}

.upload-fine-print {
  font-size: 13px;
  margin: 16px 0;
}

.upload-button,
.upload-file-button {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 50px;
  padding: 12px 25px;
  text-decoration: none;
  transition: background .2s ease, transform .2s ease;
}

.upload-button { width: 100%; }

.upload-button:hover,
.upload-button:focus,
.upload-file-button:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.upload-button:disabled {
  cursor: wait;
  opacity: .58;
  transform: none;
}

.upload-button--secondary {
  background: var(--ink);
  margin-top: 10px;
}

.upload-file-button {
  display: flex;
  margin-top: 24px;
  width: 100%;
}

.upload-file-button span {
  color: #fff !important;
  font-size: 24px;
  font-weight: 400 !important;
  line-height: 1;
  margin-right: 8px;
}

.upload-file-input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.upload-pill {
  background: #fff4ed;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  padding: 5px 10px;
}

.upload-turnstile { margin: 18px 0; min-height: 65px; }

.upload-auto-status {
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  margin: 20px 0 0;
  text-align: center;
}

.upload-code {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: .35em;
  text-align: center;
}

.upload-success {
  background: #edf8f0;
  border-radius: 9px;
  color: var(--success);
  font-weight: 700;
  padding: 11px 13px;
}

.upload-email form + form { margin-top: 20px; }

.upload-form-error {
  background: #fff0ee;
  border-radius: 9px;
  color: var(--danger);
  font-weight: 700;
  margin: 16px 0 0;
  padding: 11px 13px;
}

.upload-queue,
.uploaded-files { display: grid; gap: 12px; }

.upload-item {
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  gap: 12px;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  padding: 12px;
}

.upload-item__preview {
  align-items: center;
  background: var(--blush);
  border-radius: 9px;
  color: var(--accent-dark);
  display: flex;
  font-size: 12px;
  font-weight: 800;
  height: 50px;
  justify-content: center;
  overflow: hidden;
  text-transform: uppercase;
  width: 50px;
}

.upload-item__preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.upload-item__name {
  color: var(--ink);
  display: block;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-item__meta {
  font-size: 12px;
  margin-top: 2px;
}

.upload-item__progress {
  appearance: none;
  background: #eadbd2;
  border: 0;
  border-radius: 999px;
  display: block;
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  width: 100%;
}

.upload-item__progress::-webkit-progress-bar { background: #eadbd2; }

.upload-item__progress::-webkit-progress-value {
  background: var(--accent);
  transition: width .2s ease;
}

.upload-item__progress::-moz-progress-bar { background: var(--accent); }
.upload-item--complete .upload-item__progress::-webkit-progress-value { background: var(--success); }
.upload-item--complete .upload-item__progress::-moz-progress-bar { background: var(--success); }

.upload-item__action {
  background: transparent;
  border: 0;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  padding: 7px;
}

.upload-item--complete .upload-item__meta { color: var(--success); }
.upload-item--error .upload-item__meta { color: var(--danger); }

.upload-copy-row { display: flex; gap: 8px; }

.upload-copy-row button,
.upload-link-button {
  background: #fff4ed;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 9px 13px;
}

.upload-recovery {
  padding: 20px clamp(18px, 4vw, 28px);
  text-align: left;
}

.collection-heading {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
}

.upload-recovery h2 { font-size: clamp(22px, 4vw, 27px); margin: 0; }
.collection-status {
  background: #edf8f0;
  border-radius: 999px;
  color: var(--success);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  padding: 6px 10px;
}

.collection-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(3, 1fr);
  margin-top: 18px;
}

.collection-action {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  cursor: pointer;
  min-height: 82px;
  padding: 12px 8px;
  text-align: center;
}

.collection-action:hover,
.collection-action:focus { background: #fff4ed; }
.collection-action:disabled { cursor: wait; opacity: .58; }
.collection-action span { display: block; font-size: 24px; line-height: 1; margin-bottom: 7px; }
.collection-action strong { font-size: 13px; }

.collection-drawer {
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 18px;
}

.upload-recovery .upload-button { margin: 0 auto; max-width: 360px; }
.upload-recovery .upload-button:disabled { height: 50px; margin-top: 0; }

.collection-email {
  text-align: left;
}

.collection-email h3 {
  color: var(--ink);
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 21px;
  margin: 0 0 8px;
  text-align: center;
}

.collection-email > p { margin: 0 auto; max-width: 480px; text-align: center; }
.collection-email form + form { margin-top: 20px; }
.collection-email .upload-link-button { margin-top: 12px; }
.upload-recovery > .upload-success { max-width: 480px; }

.collection-qr-drawer {
  align-items: center;
  display: grid;
  gap: 16px;
  grid-template-columns: 104px minmax(0, 1fr);
}

.collection-qr-drawer > div:last-child > strong { color: var(--ink); }
.collection-qr-drawer p { font-size: 13px; margin: 4px 0 0; }

.recovery-qr {
  background: #fff;
  border-radius: 12px;
  margin: 0;
  padding: 8px;
  width: 104px;
}

.recovery-qr svg { display: block; height: auto; width: 100%; }
.recovery-qr span { display: block; font-size: 11px; padding: 34px 2px; text-align: center; }

.upload-link-button { display: block; margin: 0 auto; }

.upload-warning {
  color: var(--danger);
  font-size: 13px;
  margin: 10px 0 0;
  text-align: center;
}

.upload-privacy {
  box-shadow: none;
  font-size: 13px;
}

.upload-privacy h2 { font-size: 21px; }

.upload-footer {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: center;
  padding: 25px 20px 45px;
}

.upload-footer a {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.upload-spinner {
  animation: upload-spin 800ms linear infinite;
  border: 3px solid var(--line);
  border-radius: 50%;
  border-top-color: var(--accent);
  height: 22px;
  width: 22px;
}

@keyframes upload-spin { to { transform: rotate(360deg); } }

[hidden] { display: none !important; }

@media (max-width: 560px) {
  .upload-header { align-items: flex-start; }
  .upload-header p { max-width: 115px; text-align: right; }
  .upload-shell { padding-top: 24px; }
  .upload-hero p:last-child { font-size: 16px; }
  .upload-card__heading { display: block; }
  .upload-pill { display: inline-block; margin-top: 9px; }
  .upload-item { grid-template-columns: 42px minmax(0, 1fr); }
  .upload-item__preview { height: 42px; width: 42px; }
  .upload-item__action { grid-column: 2; justify-self: start; padding-left: 0; }
  .upload-copy-row { align-items: stretch; flex-direction: column; }
  .collection-actions { gap: 7px; }
  .collection-action { min-height: 72px; padding: 9px 4px; }
  .collection-action span { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
  .upload-spinner { animation-duration: 1.6s; }
}
