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

:root {
  --blue: #1a56db;
  --blue-light: #eff6ff;
  --blue-dark: #1447c0;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --white: #ffffff;
  --error: #dc2626;
  --green: #16a34a;
  --radius: 12px;
  --radius-sm: 8px;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  line-height: 1.5;
}

header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}

.step-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.step {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--white);
  transition: all 0.15s;
}

.step.active {
  color: var(--blue);
  border-color: var(--blue);
  background: var(--blue-light);
}

.step.current {
  font-weight: 700;
}

.step-arrow {
  color: var(--border);
  font-size: 0.875rem;
}

main {
  max-width: 700px;
  margin: 0 auto;
  padding: 2rem 1.5rem 6rem;
}

/* Cards */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

/* Step 1 — Instructions */
.instructions-card {
  margin-bottom: 1.5rem;
}

.instructions-card h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.instructions-card ol {
  list-style: none;
  counter-reset: steps;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.instructions-card li {
  counter-increment: steps;
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  font-size: 0.9375rem;
  color: var(--text);
}

.instructions-card li::before {
  content: counter(steps);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  flex-shrink: 0;
}

/* Drop zone */
.drop-zone {
  background: var(--white);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  text-align: center;
  outline: none;
}

.drop-zone:hover,
.drop-zone:focus-visible {
  border-color: var(--blue);
  background: var(--blue-light);
}

.drop-zone.drag-over {
  border-color: var(--blue);
  background: var(--blue-light);
}

.upload-icon {
  width: 2.5rem;
  height: 2.5rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.drop-primary {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.drop-secondary {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.link-style {
  color: var(--blue);
  text-decoration: underline;
  cursor: pointer;
}

.error-msg {
  color: var(--error);
  font-size: 0.875rem;
  margin-top: 0.75rem;
  text-align: center;
}

/* Step 2 — Name table */
.step-header {
  margin-bottom: 1.25rem;
}

.step-header h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.table-wrapper {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1rem;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

th {
  padding: 0.625rem 0.875rem;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  text-align: left;
}

td {
  padding: 0.5rem 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: #fafafa;
}

.original-name {
  font-size: 0.9375rem;
  color: var(--text);
  white-space: nowrap;
}

.label-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.4375rem 0.625rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.label-input::placeholder {
  color: #b0b7c3;
}

.label-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

/* Sticky action bar */
.action-bar {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 0.875rem 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  /* Pull out of table-wrapper visually */
  margin: 0 -0.1px;
}

/* Buttons */
.btn {
  padding: 0.625rem 1.5rem;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  line-height: 1;
}

.btn-primary {
  background: var(--blue);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.3);
}

.btn-secondary {
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
}

.btn-secondary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

/* Step 3 — Done */
.done-card {
  max-width: 420px;
  margin: 3rem auto 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.check-icon {
  width: 3.5rem;
  height: 3.5rem;
  color: var(--green);
}

.done-card h2 {
  font-size: 1.25rem;
  font-weight: 700;
}

.done-card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

.done-card code {
  font-size: 0.875em;
  background: var(--bg);
  padding: 0.1em 0.35em;
  border-radius: 4px;
  color: var(--text);
}

/* Responsive */
@media (max-width: 480px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  main {
    padding: 1.25rem 1rem 5rem;
  }

  .drop-zone {
    padding: 2rem 1rem;
  }

  th,
  td {
    padding: 0.5rem 0.5rem;
    font-size: 0.875rem;
  }

  .action-bar {
    flex-direction: column-reverse;
  }

  .action-bar .btn {
    width: 100%;
    text-align: center;
  }
}
