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

body {
  font-family: 'Inter', sans-serif;
  background: #f5f5f5;
  min-height: 100vh;
  color: #333;
}

h1, h2, h3, h4 {
  font-family: 'Karla', sans-serif;
  font-weight: 700;
}

/* Main Navigation */
.main-nav {
  background: #2c2c2c;
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
}

.lab-brand {
  color: #9d7f37;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 1.3rem;
  text-decoration: none;
}

.main-tabs {
  display: flex;
  gap: 5px;
}

.main-tab {
  background: transparent;
  color: #ccc;
  border: 2px solid transparent;
  padding: 10px 25px;
  border-radius: 4px;
  cursor: pointer;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s;
}

.main-tab:hover {
  color: #9d7f37;
  border-color: #9d7f37;
}

.main-tab.active {
  background: #9d7f37;
  color: white;
  border-color: #9d7f37;
}

/* Tool container */
.tool-container {
  max-width: 1100px;
  margin: 0 auto;
  background: white;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  overflow: hidden;
}

.tool-header {
  background: linear-gradient(135deg, #9d7f37 0%, #7a6229 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.tool-header h1 {
  font-size: 2em;
  margin-bottom: 10px;
}

.tool-header p {
  opacity: 0.9;
  font-size: 1em;
}

.tool-content {
  padding: 20px;
}

/* Panels */
.panel {
  background: #fafafa;
  border-radius: 6px;
  padding: 20px;
  margin-bottom: 20px;
}

.panel h2 {
  color: #333;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #9d7f37;
}

.field-label {
  display: block;
  font-size: 0.95em;
  font-weight: 600;
  margin-bottom: 8px;
  color: #555;
}

/* Inputs */
textarea {
  width: 100%;
  min-height: 110px;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 1em;
  resize: vertical;
  background: white;
}

textarea:focus {
  outline: none;
  border-color: #9d7f37;
}

/* Drag-and-drop file zone */
.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 160px;
  padding: 24px 20px;
  background: #ffffff;
  border: 2px dashed #c9b88a;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  color: #555;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.05s ease;
}

.drop-zone:hover {
  background: #fbf7ec;
  border-color: #9d7f37;
}

.drop-zone.dragover {
  background: #f5efe3;
  border-color: #9d7f37;
  color: #333;
}

.drop-zone .drop-icon {
  color: #9d7f37;
  opacity: 0.85;
}

.drop-zone-text {
  font-size: 1.05em;
  color: #444;
}

.drop-zone-text strong {
  color: #333;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
}

.drop-zone-link {
  color: #9d7f37;
  font-weight: 600;
  text-decoration: underline;
}

.drop-zone-hint {
  font-size: 0.85em;
  color: #888;
}

.drop-zone-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.drop-zone.has-file {
  border-style: solid;
  border-color: #9d7f37;
  background: #fbf7ec;
}

.or-divider {
  display: flex;
  align-items: center;
  margin: 18px 0 14px;
  color: #888;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e0e0e0;
}

.or-divider span {
  padding: 0 12px;
}

.file-status {
  margin-top: 8px;
  font-size: 0.9em;
  color: #666;
  min-height: 1.2em;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

/* Buttons (matches multisite gateway) */
button {
  background: #9d7f37;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1em;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  transition: background 0.3s;
}

button:hover {
  background: #7a6229;
}

button:disabled {
  background: #ccc;
  cursor: not-allowed;
}

button.secondary {
  background: #e0e0e0;
  color: #555;
}

button.secondary:hover {
  background: #cdcdcd;
}

/* Results */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #9d7f37;
}

.results-header h2 {
  margin: 0;
  padding: 0;
  border: none;
}

.progress {
  margin-bottom: 15px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e0e0e0;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: #9d7f37;
  transition: width 0.2s ease;
}

.progress-text {
  margin-top: 6px;
  font-size: 0.9em;
  color: #666;
}

.summary {
  margin-bottom: 12px;
  font-size: 0.95em;
  color: #555;
}

.table-wrapper {
  max-height: 480px;
  overflow: auto;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95em;
}

thead th {
  position: sticky;
  top: 0;
  background: #f5efe3;
  text-align: left;
  padding: 10px 12px;
  font-family: 'Karla', sans-serif;
  font-weight: 700;
  color: #333;
  border-bottom: 2px solid #9d7f37;
  z-index: 1;
}

tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
}

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

tbody td:first-child {
  font-family: 'Courier New', monospace;
  white-space: nowrap;
  color: #9d7f37;
  font-weight: 600;
}

tbody tr.not-found td:nth-child(2) {
  color: #d32f2f;
  font-style: italic;
}

tbody td:nth-child(3) a {
  color: #9d7f37;
  text-decoration: underline;
  text-decoration-color: rgba(157, 127, 55, 0.4);
  text-underline-offset: 2px;
  word-break: break-all;
  font-family: 'Inter', sans-serif;
  font-size: 0.95em;
  font-weight: 500;
}

tbody td:nth-child(3) a:hover {
  color: #7a6229;
  text-decoration-color: #7a6229;
}

.hidden {
  display: none !important;
}

.tool-footer {
  font-size: 0.9em;
  color: #888;
  text-align: center;
  padding: 16px 20px 8px;
  border-top: 1px solid #eee;
  margin-top: 10px;
}

.tool-footer a {
  color: #9d7f37;
  text-decoration: none;
  font-weight: 600;
}

.tool-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 700px) {
  .tool-header {
    padding: 24px 18px;
  }
  .tool-header h1 {
    font-size: 1.5em;
  }
  .tool-content {
    padding: 14px;
  }
  .results-header {
    flex-direction: column;
    align-items: stretch;
  }
  .results-header button {
    width: 100%;
  }
}
