* { margin: 0; padding: 0; box-sizing: border-box; border-radius: 0 !important; }
body {
  background: #fcf8f2;
  font-family: 'SF Mono', 'Cascadia Code', 'Roboto Mono', 'Consolas', monospace;
  font-size: 13px;
  color: #2e2e2e;
  padding: 1.8rem 1.2rem;
  line-height: 1.5;
}
.container { max-width: 1100px; margin: 0 auto; }
h1 {
  font-weight: 400;
  font-size: 1.5rem;
  letter-spacing: 1px;
  color: #2e2e2e;
  margin-bottom: 0.1rem;
}
.subtitle {
  color: #8a827a;
  font-size: 0.7rem;
  letter-spacing: 0.3px;
  margin-bottom: 1.8rem;
  border-left: 2px solid #d4c8bc;
  padding-left: 0.8rem;
  text-transform: uppercase;
}
.card {
  background: #fcf8f2;
  border: 1px solid #d8d0c8;
  padding: 1.2rem 1.5rem;
  margin-bottom: 1rem;
}
.card h2 {
  font-weight: 400;
  font-size: 0.8rem;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #5a5a5a;
  border-bottom: 1px solid #d8d0c8;
  padding-bottom: 0.4rem;
  margin-bottom: 0.8rem;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: flex-end;
}
.form-group {
  flex: 1 1 180px;
}
.form-group label {
  display: block;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #8a827a;
  margin-bottom: 0.1rem;
}
.form-group input, .form-group select {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border: 1px solid #d0c8c0;
  background: #fcf8f2;
  font-size: 0.8rem;
  font-family: inherit;
  color: #2e2e2e;
  transition: 0.1s;
}
.form-group input:focus, .form-group select:focus {
  outline: none;
  border-color: #b0a89c;
  box-shadow: inset 0 0 0 1px #b0a89c;
}
button {
  background: #ece6e0;
  border: 1px solid #d0c8c0;
  padding: 0.35rem 1.2rem;
  font-size: 0.75rem;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: 0.3px;
  color: #2e2e2e;
  cursor: pointer;
  transition: 0.1s;
  text-transform: uppercase;
}
button:hover { background: #e0d8d0; border-color: #b8b0a8; }
button:active { transform: scale(0.97); }
button:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
button.primary { background: #d8d0c8; border-color: #c0b8b0; }
button.primary:hover { background: #ccc4bc; }
button.success { background: #d0d8cc; border-color: #b8c8b8; color: #2e4a2e; }
button.success:hover { background: #c4d0c0; }
button.secondary { background: #ece8e4; border-color: #d0c8c0; }
.flex { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.mt-1 { margin-top: 0.8rem; }
.mb-1 { margin-bottom: 0.8rem; }
.text-muted { color: #8a827a; font-size: 0.75rem; }

.drop-zone {
  border: 1px solid #d0c8c0;
  padding: 1.4rem 1rem;
  text-align: center;
  background: #fcf8f2;
  cursor: pointer;
  color: #8a827a;
  font-size: 0.8rem;
  transition: 0.1s;
}
.drop-zone.dragover { border-color: #b0a89c; background: #f6f0ea; }
.drop-zone input[type="file"] { display: none; }
.file-name { font-weight: 500; color: #2e2e2e; }

.step-tracker {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.2rem 0 0.6rem;
  padding: 0.2rem 0;
}
.step {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: #8a827a;
  transition: color 0.3s ease;
  white-space: nowrap;
}
.step .icon {
  display: inline-block;
  width: 1.4rem;
  text-align: center;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}
.step.active .icon { color: #2e2e2e; animation: pulse-icon 1.2s infinite; }
.step.active .label { color: #2e2e2e; font-weight: 500; }
.step.done .icon { color: #4a7a4a; }
.step.done .label { color: #4a7a4a; }
.step-connector {
  flex: 0 0 1.2rem;
  height: 1px;
  background: #d0c8c0;
  position: relative;
  transition: background 0.4s ease;
}
.step-connector.done { background: #b0c8b0; }
.step-connector .fill {
  height: 100%;
  width: 0%;
  background: #b0c8b0;
  transition: width 0.6s ease;
}
.step-connector.done .fill { width: 100%; }
@keyframes pulse-icon {
  0% { opacity: 0.4; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.1); }
  100% { opacity: 0.4; transform: scale(0.9); }
}
.progress-bar {
  width: 100%;
  height: 2px;
  background: #e8e2dc;
  margin: 0.4rem 0 0.2rem;
}
.progress-bar .fill {
  height: 100%;
  width: 0%;
  background: #b0a89c;
  transition: width 0.7s ease;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin: 0.4rem 0 0.8rem;
}
.stat-item {
  background: #f0ece6;
  padding: 0.2rem 0.8rem;
  font-size: 0.75rem;
  border: 1px solid #d8d0c8;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.stat-item strong { font-weight: 500; }
.table-wrap {
  overflow-x: auto;
  margin: 0.6rem 0;
  border: 1px solid #d8d0c8;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.7rem;
  font-family: inherit;
}
th {
  background: #f0ece6;
  text-align: left;
  padding: 0.3rem 0.5rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #4a4a4a;
  border-bottom: 1px solid #d8d0c8;
  white-space: nowrap;
}
td {
  padding: 0.25rem 0.5rem;
  border-bottom: 1px solid #e8e2dc;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-feature-settings: "tnum";
}
tr.flagged { background: #fcf0ec; }
tr.flagged td:first-child::before { content: "▸ "; color: #b05a5a; }
#resultsSection { display: none; }
.hidden { display: none !important; }

/* ─── MODAL ─────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: var(--surface, #fcf8f2);
  border-radius: 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  padding: 20px 24px 24px;
  max-width: 360px;
  width: 100%;
  border: 1px solid #d0c8c0;
  background: #fcf8f2;
}
.modal-box h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #5a5a5a;
  margin-bottom: 6px;
  border-bottom: 1px solid #d8d0c8;
  padding-bottom: 6px;
}
.modal-box .modal-label {
  display: block;
  font-size: 10px;
  font-weight: 500;
  color: #2e2e2e;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: #8a827a;
}
.modal-box .modal-message {
  font-size: 11px;
  color: #5a5a5a;
  margin-bottom: 12px;
  line-height: 1.4;
}
.modal-box input[type="text"] {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid #d0c8c0;
  border-radius: 0;
  font-family: inherit;
  font-size: 11px;
  background: #fcf8f2;
  color: #2e2e2e;
  outline: none;
  transition: border 0.15s;
  height: 28px;
}
.modal-box input[type="text"]:focus {
  border-color: #b0a89c;
  box-shadow: inset 0 0 0 1px #b0a89c;
}
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.modal-actions .btn {
  min-width: 60px;
  justify-content: center;
}