:root {
  --bg: #f7f3ef;
  --ink: #2b2622;
  --muted: #7a7269;
  --accent: #8a5a44;
  --accent-ink: #fff;
  --card: #fff;
  --line: #e6dfd6;
  --ok: #2e7d32;
  --err: #b3261e;
  --radius: 14px;
  --pad: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: 600px;
  margin: 0 auto;
  padding: max(env(safe-area-inset-top), 20px) var(--pad) calc(env(safe-area-inset-bottom) + 40px);
}

header {
  text-align: center;
  margin: 8px 0 24px;
}

h1 {
  font-family: "Cormorant Garamond", "Hoefler Text", Georgia, serif;
  font-weight: 500;
  font-size: 34px;
  margin: 0 0 6px;
  letter-spacing: 0.5px;
}

.subtitle {
  color: var(--muted);
  margin: 0;
}

.field {
  display: block;
  margin: 0 0 16px;
}
.field span {
  display: block;
  font-size: 14px;
  margin-bottom: 6px;
  color: var(--ink);
}
.field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  font-size: 16px;
  color: var(--ink);
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.muted { color: var(--muted); font-weight: 400; }
.small { font-size: 13px; }

.pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 8px 0 18px;
}

.pick-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.pick-btn--secondary {
  background: var(--card);
  color: var(--accent);
  border: 1px solid var(--accent);
}
.pick-btn:active { transform: scale(0.99); }

.items { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }

.item {
  display: grid;
  grid-template-columns: 84px 1fr auto;
  gap: 12px;
  align-items: start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}
.item .thumb {
  width: 84px;
  height: 84px;
  background: #ddd center/cover no-repeat;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--muted);
}
.item .thumb img,
.item .thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}
.item .meta { min-width: 0; }
.item .filename {
  font-size: 13px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}
.item .note {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  background: #fff;
}
.item .progress {
  height: 4px;
  background: var(--line);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
  display: none;
}
.item.uploading .progress,
.item.done .progress,
.item.error .progress { display: block; }
.item .bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 120ms linear;
}
.item.done .bar { background: var(--ok); width: 100% !important; }
.item.error .bar { background: var(--err); }
.item .state {
  font-size: 12px;
  margin-top: 4px;
  color: var(--muted);
  min-height: 16px;
}
.item.done .state { color: var(--ok); }
.item.error .state { color: var(--err); }
.item .remove {
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 26px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
}
.item.uploading .remove,
.item.done .remove { display: none; }

.turnstile { margin: 4px 0 12px; min-height: 0; }

.submit {
  display: block;
  width: 100%;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  background: var(--accent);
  color: var(--accent-ink);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.submit:active:not(:disabled) { transform: scale(0.99); }

.status { text-align: center; margin: 14px 0 0; min-height: 22px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.err { color: var(--err); }

footer { margin-top: 32px; text-align: center; }
