*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e2e5ea;
  --text: #1a1d23;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-bg: #eff6ff;
  --accent-border: #bfdbfe;
  --accent-text: #1d4ed8;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-text: #15803d;
  --warning: #d97706;
  --warning-bg: #fef9c3;
  --warning-text: #a16207;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --danger-text: #b91c1c;
  --danger-border: #fca5a5;
  --disabled-bg: #93c5fd;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,.08);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 80px;
}

header {
  text-align: center;
  margin-bottom: 36px;
}
header h1 { font-size: 1.75rem; font-weight: 700; }
header p  { color: var(--text-muted); margin-top: 6px; font-size: .95rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  width: 100%;
  max-width: 700px;
}
.card + .card { margin-top: 20px; }

.card h2 { font-size: 1.05rem; font-weight: 600; margin-bottom: 18px; }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .2s, background .2s;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.drop-zone:focus {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.drop-zone-accepted {
  border-color: var(--success);
  border-style: solid;
  background: var(--success-bg);
}
.drop-zone-accepted .icon { color: var(--success); }
.drop-zone-accepted strong { color: var(--success-text); }
.drop-zone input[type="file"] { display: none; }
.drop-zone .icon { font-size: 2rem; margin-bottom: 10px; }
.drop-zone p   { color: var(--text-muted); font-size: .9rem; }
.drop-zone strong { color: var(--accent); }

/* Form elements */
label { display: block; font-size: .85rem; font-weight: 500; margin-bottom: 6px; color: var(--text-muted); }
select, input[type="text"] {
  width: 100%;
  padding: 9px 32px 9px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: .95rem;
  background: var(--surface);
  color: var(--text);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
select:focus, input[type="text"]:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.form-row { margin-top: 16px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }

@media (max-width: 480px) {
  .form-row-2 { grid-template-columns: 1fr; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: .95rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: background .15s;
  text-decoration: none;
}
.btn-primary  { background: var(--accent); color: #fff; }
.btn-primary:hover  { background: var(--accent-hover); text-decoration: none; }
.btn-primary:disabled { background: var(--disabled-bg); cursor: not-allowed; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-lg { padding: 12px 28px; font-size: 1rem; margin-top: 24px; }
.btn-block { width: 100%; }
.btn-constrained { max-width: 320px; width: 100%; margin-left: auto; margin-right: auto; }

/* Sample table */
.table-wrap { overflow-x: auto; margin-top: 14px; }
table { width: 100%; border-collapse: collapse; font-size: .85rem; }
th { background: var(--bg); text-align: left; padding: 8px 12px; font-weight: 600; border-bottom: 1px solid var(--border); }
td { padding: 7px 12px; border-bottom: 1px solid var(--border); color: var(--text-muted); white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis; }
tr:last-child td { border-bottom: none; }

/* Progress bar */
.progress-wrap { margin: 20px 0; }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; color: var(--text-muted); margin-bottom: 8px; }
.progress-bar { height: 10px; background: var(--bg); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.progress-fill { height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s ease; }

/* Stat grid */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-top: 8px; }
.stat-box { background: var(--bg); border-radius: 8px; padding: 14px 16px; text-align: center; }
.stat-box .num { font-size: 1.6rem; font-weight: 700; }
.stat-box .lbl { font-size: .78rem; color: var(--text-muted); margin-top: 2px; }
.stat-total .num   { color: var(--accent); }
.stat-success .num { color: var(--success); }
.stat-partial .num { color: var(--warning); }
.stat-empty .num   { color: var(--text-muted); }
.stat-failed .num  { color: var(--danger); }
.stat-accent .num  { color: var(--accent); }

/* Status badge */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: .78rem;
  font-weight: 600;
}
.badge-running  { background: var(--accent-bg);  color: var(--accent-text); }
.badge-complete { background: var(--success-bg); color: var(--success-text); }
.badge-error    { background: var(--danger-bg);  color: var(--danger-text); }
.badge-pending  { background: var(--bg);         color: var(--text-muted); }

/* Spinner */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Alerts */
.alert { padding: 12px 16px; border-radius: 6px; font-size: .9rem; margin-top: 12px; }
.alert-error { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid var(--danger-border); }
.alert-info  { background: var(--accent-bg);  color: var(--accent-text);  border: 1px solid var(--accent-border); display: flex; align-items: center; gap: 10px; }

/* Utils */
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); font-size: .9rem; }
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Hero */
.hero {
  width: 100%;
  max-width: 700px;
  text-align: center;
  margin-bottom: 32px;
}
.hero h2 {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 10px;
}
.hero > p { color: var(--text-muted); font-size: .95rem; }
.hero .trust {
  font-size: .8rem;
  color: var(--text-muted);
  margin-top: 14px;
}

/* How it works steps */
.steps {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 18px;
  flex-wrap: wrap;
}
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 16px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Footer */
footer {
  width: 100%;
  max-width: 700px;
  text-align: center;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text-muted);
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--accent); text-decoration: underline; }
footer p + p { margin-top: 6px; }

/* Prose content (about/terms/privacy) */
.prose h2 { font-size: 1rem; font-weight: 600; margin: 22px 0 8px; }
.prose h2:first-child { margin-top: 0; }
.prose p { font-size: .9rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 10px; }
.prose ul { font-size: .9rem; color: var(--text-muted); line-height: 1.6; padding-left: 20px; margin-bottom: 10px; }
.prose li { margin-bottom: 4px; }
