:root {
  --bg: #f7f5f2;
  --card-bg: #ffffff;
  --text: #2b2b2b;
  --muted: #767169;
  --accent: #9c7c5c;
  --accent-dark: #7e6248;
  --border: #e7e2da;
  --success-bg: #eef6ee;
  --success-text: #2f5d34;
  --error-bg: #fbeceb;
  --error-text: #8a2d26;
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
}

.card {
  width: 100%;
  max-width: 440px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.header {
  text-align: center;
}

.header h1 {
  font-size: 1.5rem;
  margin: 0 0 8px;
  font-weight: 700;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
}

.table-badge {
  display: inline-block;
  margin: 14px auto 0;
  padding: 6px 14px;
  background: #f1ece3;
  color: var(--accent-dark);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
}

.screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.screen[hidden] {
  display: none;
}

.pick-button {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 18px 20px;
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease;
}

.pick-button:active {
  background: var(--accent-dark);
}

.pick-icon {
  font-size: 1.3rem;
}

.hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
}

.secondary-button {
  width: 100%;
  background: transparent;
  color: var(--accent-dark);
  border: 2px solid var(--border);
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.file-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.file-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.file-name {
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}

.file-status {
  font-size: 0.8rem;
  font-weight: 600;
  flex-shrink: 0;
}

.file-status.pending { color: var(--muted); }
.file-status.uploading { color: var(--accent-dark); }
.file-status.done { color: var(--success-text); }
.file-status.error { color: var(--error-text); }

.progress-track {
  width: 100%;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

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

.file-item.done .progress-fill {
  background: #4c9a52;
  width: 100% !important;
}

.file-item.error .progress-fill {
  background: #c0463c;
}

.retry-button {
  align-self: flex-end;
  background: none;
  border: none;
  color: var(--accent-dark);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 2px 0;
  cursor: pointer;
  text-decoration: underline;
}

.done-icon {
  font-size: 2.4rem;
}

.done-message {
  margin: 0;
  text-align: center;
  font-size: 1.05rem;
  font-weight: 600;
}

.footer-note {
  margin: 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.75rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1b1a18;
    --card-bg: #262420;
    --text: #f1eee9;
    --muted: #a39d93;
    --border: #39362f;
    --accent: #c79a6e;
    --accent-dark: #e0b588;
    --success-text: #8fd396;
    --error-text: #f29189;
  }
}
