:root {
  color-scheme: light dark;
  --bg: #f6f7fb;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #646b7a;
  --line: #d9dde6;
  --accent: #2f66d0;
  --accent-text: #ffffff;
  --bad: #c0362c;
  --good: #1c8a4f;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c;
    --card: #1e2129;
    --text: #e8eaf0;
    --muted: #a2a8b6;
    --line: #333844;
    --accent: #7ba4f5;
    --accent-text: #10131a;
    --bad: #f0857b;
    --good: #5fcf94;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overflow-x: clip;
}

main {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 16px calc(40px + env(safe-area-inset-bottom));
}

.brand { margin: 0 0 18px; font-size: 14px; font-weight: 600; color: var(--muted); letter-spacing: 0.02em; }

h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.2; }

h2 { margin: 0 0 6px; font-size: 24px; }

.lede { margin: 0 0 22px; color: var(--muted); overflow-wrap: anywhere; }

label { display: block; margin: 18px 0 6px; font-weight: 600; }

label span[aria-hidden] { color: var(--bad); }

/* 16px or larger stops iPhones from zooming the page when a field gets focus. */
input[type="text"], input[type="tel"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}

input:focus-visible, .picker:focus-within, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.picker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 26px 16px;
  border: 2px dashed var(--line);
  border-radius: 10px;
  background: var(--card);
  text-align: center;
  cursor: pointer;
  font-weight: 400;
}

.picker.is-over { border-color: var(--accent); }

.picker-title { color: var(--accent); font-size: 17px; font-weight: 600; }

.picker-note { color: var(--muted); font-size: 14px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  border: 0;
}

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.files { list-style: none; margin: 12px 0 0; padding: 0; }

.files li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.file-meta { flex: none; color: var(--muted); font-size: 14px; }

.file-meta.is-done { color: var(--good); }

.file-meta.is-bad { color: var(--bad); }

.remove {
  flex: none;
  width: auto;
  min-height: 36px;
  margin: 0;
  padding: 4px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.challenge:not(:empty) { margin-top: 18px; }

.message { margin: 16px 0 0; color: var(--bad); overflow-wrap: anywhere; }

button {
  display: block;
  width: 100%;
  min-height: 50px;
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

button:disabled { opacity: 0.6; cursor: default; }

.status { margin: 0 0 12px; font-weight: 600; overflow-wrap: anywhere; }

.bar { height: 10px; border-radius: 5px; background: var(--line); overflow: hidden; }

#bar-fill { height: 100%; width: 0; background: var(--accent); transition: width 0.25s ease-out; }

.keep-open { margin: 12px 0 0; color: var(--muted); font-size: 14px; }

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  #bar-fill { transition: none; }
}
