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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
  color: #333;
  line-height: 1.6;
}

.container {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1rem;
}

h1 {
  text-align: center;
  margin-bottom: 2rem;
  color: #1a1a1a;
}

h2 {
  margin-bottom: 1rem;
}

/* Step indicator */
.steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 2rem;
  background: white;
  border-radius: 8px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.step {
  flex: 1;
  text-align: center;
  padding: 0.5rem;
  color: #999;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
}

.step.active {
  color: #2563eb;
  font-weight: 600;
  border-bottom-color: #2563eb;
}

.step.completed {
  color: #16a34a;
  border-bottom-color: #16a34a;
}

/* Step content */
.step-content {
  display: none;
  background: white;
  border-radius: 8px;
  padding: 2rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.step-content.active {
  display: block;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 1rem;
}

.form-group textarea {
  font-family: monospace;
  resize: vertical;
}

/* Buttons */
.btn {
  padding: 0.75rem 1.5rem;
  background: #2563eb;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}

.btn:hover {
  background: #1d4ed8;
}

.btn:disabled {
  background: #93c5fd;
  cursor: not-allowed;
}

.btn-secondary {
  background: #6b7280;
}

.btn-secondary:hover {
  background: #4b5563;
}

.btn-large {
  padding: 1rem 2rem;
  font-size: 1.2rem;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
}

/* Drop zone */
.drop-zone {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  margin-bottom: 1rem;
  transition: border-color 0.2s, background 0.2s;
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: #2563eb;
  background: #eff6ff;
}

.drop-zone .hint {
  color: #999;
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

/* File list */
.file-list {
  margin-bottom: 1rem;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: #f9fafb;
  border-radius: 4px;
  margin-bottom: 0.25rem;
}

.file-item .filename {
  flex: 1;
}

.file-item .badge {
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pending {
  background: #fef3c7;
  color: #92400e;
}

.badge-processing {
  background: #dbeafe;
  color: #1e40af;
}

.badge-done {
  background: #dcfce7;
  color: #166534;
}

.badge-error {
  background: #fee2e2;
  color: #991b1b;
}

.badge-type {
  background: #e0e7ff;
  color: #3730a3;
}

.progress-text {
  padding: 0.25rem 0.75rem 0.5rem;
  font-size: 0.8rem;
  color: #6b7280;
  font-style: italic;
}

/* Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.tab {
  padding: 0.5rem 1rem;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: #6b7280;
}

.tab.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}

/* Review tables */
.review-section {
  display: none;
}

.review-section.active {
  display: block;
}

.review-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

.review-table th,
.review-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.review-table th {
  background: #f9fafb;
  font-weight: 600;
  font-size: 0.85rem;
  color: #6b7280;
}

.review-table input {
  width: 100%;
  padding: 0.25rem 0.5rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}

.review-card {
  background: #f9fafb;
  border-radius: 8px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.review-card h4 {
  margin-bottom: 0.75rem;
  color: #1a1a1a;
}

/* Walkthrough layout */
#step-3 {
  max-width: 1200px;
}

.walkthrough-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

#page-counter {
  font-weight: 600;
  color: #374151;
}

.walkthrough-body {
  display: flex;
  gap: 1.5rem;
  min-height: 400px;
}

.walkthrough-image {
  flex: 0 0 55%;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f9fafb;
}

.walkthrough-image img {
  width: 100%;
  display: block;
  cursor: zoom-in;
}

.walkthrough-data {
  flex: 1;
  overflow-y: auto;
}

/* Document type dropdown */
.doc-type-select {
  appearance: auto;
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.doc-type-select:hover {
  background: #c7d2fe;
}

.doc-type-select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.reclassify-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: #6b7280;
  gap: 0.75rem;
}

.skip-notice,
.continuation-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200px;
  border: 2px dashed #d1d5db;
  border-radius: 8px;
  color: #9ca3af;
  font-size: 0.95rem;
  text-align: center;
  padding: 1rem;
}

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  overflow: auto;
}

.lightbox-content img {
  display: block;
  max-width: 90vw;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  font-size: 2rem;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.lightbox-close:hover {
  background: rgba(0, 0, 0, 0.85);
}
