:root {
  --bg: #f7f3ee;
  --card: #ffffff;
  --ink: #2a2a2a;
  --muted: #7a7a7a;
  --accent: #b08968;
  --accent-ink: #ffffff;
  --good: #5b8a3e;
  --bad: #b94a4a;
  --line: #e6dfd5;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.04);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 17px;
  line-height: 1.4;
}

main {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px 20px 80px;
  padding-top: max(28px, env(safe-area-inset-top));
}

header {
  text-align: center;
  margin-bottom: 28px;
}

h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.tagline {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.error-banner {
  background: #fbeaea;
  color: var(--bad);
  border: 1px solid #f0c8c8;
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
  margin: 20px 0;
}

.name-field {
  display: block;
  margin-bottom: 18px;
}

.name-field span {
  display: block;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  margin-left: 4px;
}

.name-field input {
  width: 100%;
  font-size: 1.05rem;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}

.name-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.picker {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 1.1rem;
  font-weight: 500;
  padding: 22px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  box-shadow: var(--shadow);
  transition: transform 0.06s ease;
}

.picker:active {
  transform: scale(0.98);
}

.picker input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.picker-icon {
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 400;
}

.counter {
  margin: 22px 4px 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.queue {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.tile {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  align-items: center;
  box-shadow: var(--shadow);
}

.thumb {
  width: 56px;
  height: 56px;
  border-radius: 10px;
  background: #eee no-repeat center / cover;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--muted);
}

.tile-body {
  flex: 1;
  min-width: 0;
}

.tile-name {
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 6px;
}

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

.bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s linear;
}

.tile.done .bar-fill {
  background: var(--good);
  width: 100% !important;
}

.tile.failed .bar-fill {
  background: var(--bad);
}

.status {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.tile.done .status {
  color: var(--good);
}

.tile.failed .status {
  color: var(--bad);
}

.retry {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  margin: -4px -8px;
  font-family: inherit;
}

.celebrate {
  margin-top: 28px;
  text-align: center;
  font-size: 1.15rem;
  color: var(--good);
  background: var(--card);
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
