/* ==========================================================================
   Relievo Aviation - Smart Image Matcher & Extractor Design System
   Pipeline: Folder A (Samples) ➔ Folder B (Dump) ➔ Folder C (Target)
   Apple Liquid Frosted Glass | OLED Midnight Obsidian & Sunlight Tarmac Mode
   ========================================================================== */

/* Pipeline Workflow Progress Bar / Step Indicator */
.matcher-pipeline-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 24px;
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  box-shadow: var(--shadow-liquid);
  position: relative;
  overflow: hidden;
  gap: 12px;
}

.matcher-step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.matcher-step-badge {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--dim);
  transition: var(--transition-smooth);
  flex-shrink: 0;
}

.matcher-step-item.active .matcher-step-badge {
  background: var(--cyan);
  color: #0b0f17;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.4);
  border-color: transparent;
}

.matcher-step-item.ready .matcher-step-badge {
  background: var(--accent-green);
  color: #0b0f17;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.4);
  border-color: transparent;
}

.matcher-step-content {
  display: flex;
  flex-direction: column;
}

.matcher-step-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--white);
  line-height: 1.2;
}

.matcher-step-desc {
  font-size: 0.75rem;
  color: var(--dim);
  margin-top: 2px;
}

.matcher-step-arrow {
  color: rgba(255, 255, 255, 0.25);
  font-size: 1.2rem;
  font-weight: 300;
  flex-shrink: 0;
}

/* 3-Column Folder Setup Ingestion Grid */
.matcher-folders-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

@media (max-width: 1024px) {
  .matcher-folders-grid {
    grid-template-columns: 1fr;
  }
  .matcher-pipeline-stepper {
    flex-direction: column;
    align-items: flex-start;
  }
  .matcher-step-arrow {
    display: none;
  }
}

.matcher-folder-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-liquid);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.matcher-folder-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateY(-2px);
}

.matcher-folder-card.card-folder-a {
  border-top: 3px solid var(--cyan);
}

.matcher-folder-card.card-folder-b {
  border-top: 3px solid var(--accent-amber);
}

.matcher-folder-card.card-folder-c {
  border-top: 3px solid var(--accent-green);
}

.matcher-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.matcher-card-icon-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.matcher-card-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.matcher-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.matcher-card-subtitle {
  font-size: 0.78rem;
  color: var(--dim);
  margin-top: 2px;
}

.matcher-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--dim);
}

.matcher-status-pill.ready-cyan {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: var(--cyan);
}

.matcher-status-pill.ready-amber {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: var(--accent-amber);
}

.matcher-status-pill.ready-green {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.35);
  color: var(--accent-green);
}

/* Dropzones & Action Areas */
.matcher-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 24px 16px;
  text-align: center;
  background: rgba(0, 0, 0, 0.15);
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}

.matcher-dropzone:hover,
.matcher-dropzone.dragover {
  border-color: var(--cyan);
  background: rgba(56, 189, 248, 0.08);
  transform: scale(0.99);
}

.card-folder-b .matcher-dropzone:hover,
.card-folder-b .matcher-dropzone.dragover {
  border-color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.08);
}

.card-folder-c .matcher-dropzone:hover,
.card-folder-c .matcher-dropzone.dragover {
  border-color: var(--accent-green);
  background: rgba(16, 185, 129, 0.08);
}

.matcher-dropzone-prompt {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--white);
}

.matcher-dropzone-sub {
  font-size: 0.74rem;
  color: var(--dim);
}

/* Action button strips inside cards */
.matcher-card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}

.matcher-card-actions .btn {
  flex: 1;
}

/* Samples Mini Gallery Preview (Folder A) */
.matcher-samples-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 10px 2px;
  scrollbar-width: thin;
  min-height: 72px;
  align-items: center;
}

.matcher-sample-thumb-card {
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  flex-shrink: 0;
  background: #000;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.matcher-sample-thumb-card:hover {
  transform: scale(1.08);
  border-color: var(--cyan);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.matcher-sample-thumb-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.matcher-sample-remove-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
  transition: var(--transition-smooth);
}

.matcher-sample-remove-btn:hover {
  opacity: 1;
  background: var(--accent-rose);
  transform: scale(1.15);
}

.matcher-sample-badge-count {
  position: absolute;
  bottom: 2px;
  left: 2px;
  background: rgba(0, 0, 0, 0.75);
  color: var(--cyan);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 4px;
  border-radius: 4px;
}

.matcher-sample-side-pill {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0, 0, 0, 0.88);
  font-size: 9px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 3px;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: var(--dim);
  transition: var(--transition-smooth);
  user-select: none;
}

.matcher-sample-side-pill:hover {
  transform: scale(1.1);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.5);
}

.matcher-sample-side-pill.side-lh {
  color: #34d399;
  border-color: rgba(52, 211, 153, 0.6);
  background: rgba(5, 150, 105, 0.3);
}

.matcher-sample-side-pill.side-rh {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.6);
  background: rgba(217, 119, 6, 0.3);
}

/* Parameters & Engine Configuration Panel */
.matcher-config-panel {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-liquid);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
}

.matcher-config-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.matcher-config-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matcher-config-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.matcher-config-label .val-tag {
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 0.85rem;
}

.matcher-select,
.matcher-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--white);
  font-size: 0.85rem;
  font-family: var(--font-sans);
  outline: none;
  transition: var(--transition-smooth);
}

.matcher-select:focus,
.matcher-input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

/* Preset Threshold Pills */
.matcher-preset-pills {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.matcher-preset-pill {
  padding: 4px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--glass-border);
  color: var(--dim);
  cursor: pointer;
  transition: var(--transition-smooth);
}

.matcher-preset-pill:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.25);
}

.matcher-preset-pill.active {
  background: rgba(56, 189, 248, 0.2);
  border-color: var(--cyan);
  color: var(--cyan);
  font-weight: 700;
}

/* Sensitivity Range Slider */
.matcher-slider-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matcher-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

.matcher-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--cyan);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
  transition: var(--transition-smooth);
}

.matcher-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Master Action Button Row */
.matcher-master-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 18px;
  gap: 16px;
  flex-wrap: wrap;
}

.matcher-start-btn {
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
  color: #fff;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.35);
}

.matcher-start-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(2, 132, 199, 0.5);
  background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
}

.matcher-start-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Progress & Live Processing Container */
.matcher-progress-container {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-liquid);
  display: none;
  animation: fadeInTools 0.3s ease-out;
}

.matcher-progress-container.active {
  display: block;
}

.matcher-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.matcher-progress-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 10px;
}

.matcher-progress-bar-bg {
  width: 100%;
  height: 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  margin-bottom: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.matcher-progress-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  border-radius: 5px;
  transition: width 0.15s ease-out;
  position: relative;
  overflow: hidden;
}

.matcher-progress-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0; right: 0;
  background-image: linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.2) 25%,
    transparent 25%,
    transparent 50%,
    rgba(255, 255, 255, 0.2) 50%,
    rgba(255, 255, 255, 0.2) 75%,
    transparent 75%,
    transparent
  );
  background-size: 20px 20px;
  animation: moveStripes 1.5s linear infinite;
}

@keyframes moveStripes {
  0% { background-position: 0 0; }
  100% { background-position: 20px 0; }
}

.matcher-metrics-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--dim);
  flex-wrap: wrap;
  gap: 12px;
}

.matcher-metric-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.matcher-metric-item strong {
  color: var(--white);
}

/* Results & Extraction Review Section */
.matcher-results-section {
  display: none;
  animation: fadeInTools 0.4s ease-out;
}

.matcher-results-section.active {
  display: block;
}

.matcher-results-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(15, 23, 42, 0.8) 100%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.matcher-results-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.matcher-results-count-pill {
  padding: 4px 12px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--accent-green);
}

.matcher-results-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* Filter & Search Toolbar */
.matcher-toolbar {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.matcher-toolbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}

.matcher-toolbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Match Cards Grid */
.matcher-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 16px;
  margin-bottom: 30px;
}

.matcher-match-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: var(--transition-smooth);
  position: relative;
}

.matcher-match-card:hover {
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(30, 41, 59, 0.7);
  transform: translateY(-2px);
}

.matcher-match-card.excluded {
  opacity: 0.45;
  border-color: rgba(244, 63, 94, 0.3);
}

.matcher-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.matcher-select-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--white);
  user-select: none;
}

.matcher-select-checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent-green);
  cursor: pointer;
}

.matcher-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.matcher-score-badge.score-emerald {
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: var(--accent-green);
}

.matcher-score-badge.score-cyan {
  background: rgba(56, 189, 248, 0.18);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: var(--cyan);
}

.matcher-score-badge.score-amber {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: var(--accent-amber);
}

/* Dual Side-by-Side Thumbnails on Card */
.matcher-dual-preview-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.matcher-thumb-box {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.matcher-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.matcher-thumb-box:hover img {
  transform: scale(1.06);
}

.matcher-thumb-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.matcher-thumb-tag.tag-sample {
  color: var(--cyan);
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.matcher-thumb-tag.tag-dump {
  color: var(--accent-amber);
  border: 1px solid rgba(245, 158, 11, 0.4);
}

/* Card Details Footer */
.matcher-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 10px;
  font-size: 0.74rem;
  color: var(--dim);
}

.matcher-file-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 220px;
}

.matcher-file-name {
  font-weight: 600;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matcher-file-sub {
  font-size: 0.68rem;
  color: var(--dim);
}

.matcher-card-btn-strip {
  display: flex;
  gap: 6px;
}

.matcher-btn-icon-sm {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--dim);
  padding: 4px 8px;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.matcher-btn-icon-sm:hover {
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
}

/* ==========================================================================
   Side-by-Side Comparison Lightbox Modal
   ========================================================================== */
.matcher-modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  padding: 20px;
  animation: fadeInTools 0.25s ease-out;
}

.matcher-modal-backdrop.active {
  display: flex;
}

.matcher-modal-window {
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 1100px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.matcher-modal-header {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.matcher-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.matcher-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.matcher-compare-views-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.matcher-compare-view-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.matcher-compare-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  justify-content: space-between;
}

.matcher-compare-img-wrap {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.matcher-compare-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

/* Split Curtain Slider Mode in Modal */
.matcher-curtain-container {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  display: none;
  margin-bottom: 20px;
}

.matcher-curtain-container.active {
  display: block;
}

.matcher-curtain-img-under,
.matcher-curtain-img-over {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.matcher-curtain-img-under img,
.matcher-curtain-img-over img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.matcher-curtain-img-over {
  overflow: hidden;
  width: 50%;
  border-right: 2px solid var(--cyan);
}

.matcher-curtain-slider-handle {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cyan);
  color: #0b0f17;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 800;
  cursor: ew-resize;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.7);
  pointer-events: none;
}

/* Comparison Metric Breakdown Table */
.matcher-metrics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-top: 14px;
}

.matcher-metrics-table th,
.matcher-metrics-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.matcher-metrics-table th {
  color: var(--dim);
  font-weight: 600;
}

.matcher-metrics-table td {
  color: var(--white);
}

/* Tarmac Sunlight Mode Adjustments */
body.tarmac-mode .matcher-pipeline-stepper,
body.tarmac-mode .matcher-folder-card,
body.tarmac-mode .matcher-config-panel,
body.tarmac-mode .matcher-progress-container,
body.tarmac-mode .matcher-toolbar,
body.tarmac-mode .matcher-match-card,
body.tarmac-mode .matcher-modal-window {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #1e293b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

body.tarmac-mode .matcher-card-title,
body.tarmac-mode .matcher-step-title,
body.tarmac-mode .matcher-dropzone-prompt,
body.tarmac-mode .matcher-config-label,
body.tarmac-mode .matcher-progress-title,
body.tarmac-mode .matcher-file-name,
body.tarmac-mode .matcher-modal-title,
body.tarmac-mode .matcher-metrics-table td {
  color: #0f172a;
}

body.tarmac-mode .matcher-select,
body.tarmac-mode .matcher-input {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

body.tarmac-mode .matcher-dropzone {
  background: #f1f5f9;
  border-color: #94a3b8;
}

/* Deep Cognitive AI Inspector Styles */
.matcher-cognitive-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
  letter-spacing: 0.02em;
}

.matcher-veto-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.5);
  color: #f87171;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
  letter-spacing: 0.02em;
}

.matcher-component-tag {
  font-size: 0.72rem;
  font-weight: 600;
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.matcher-inspector-notes-box {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 6px;
  padding: 8px 10px;
  margin-top: 8px;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #e2e8f0;
  display: none;
}

.matcher-inspector-notes-box.active {
  display: block;
  animation: fadeIn 0.2s ease-in;
}

.matcher-notes-toggle-btn {
  background: none;
  border: none;
  color: #38bdf8;
  font-size: 0.7rem;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  display: inline-block;
  margin-top: 4px;
}

.matcher-notes-toggle-btn:hover {
  color: #7dd3fc;
}

.btn-cognitive-verify {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  font-weight: 700;
  border: 1px solid rgba(16, 185, 129, 0.6);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s ease;
}

.btn-cognitive-verify:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  box-shadow: 0 0 20px rgba(16, 185, 129, 0.6);
  transform: translateY(-1px);
}

.matcher-sample-study-tag {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(56, 189, 248, 0.45);
  border-radius: 4px;
  padding: 2px 5px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #38bdf8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  backdrop-filter: blur(4px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.5);
}

.matcher-direction-verified-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(14, 165, 233, 0.2);
  border: 1px solid rgba(14, 165, 233, 0.5);
  color: #38bdf8;
}

/* ==========================================================================
   Sample-Centric Results Matrix (Folder A Reference + Top 2 Dump Matches)
   Mobile First & Small Screen Responsive Enhancements
   ========================================================================== */

/* The cards grid becomes a flex column of sample matrix rows */
.matcher-cards-grid {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 30px;
}

.matcher-sample-row {
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 20px;
  box-shadow: var(--shadow-liquid);
  backdrop-filter: var(--glass-backdrop);
  -webkit-backdrop-filter: var(--glass-backdrop);
  transition: var(--transition-smooth);
  position: relative;
  align-items: stretch;
}

.matcher-sample-row:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.matcher-sample-row.status-matched-2 {
  border-left: 4px solid var(--accent-green);
}

.matcher-sample-row.status-matched-1 {
  border-left: 4px solid var(--cyan);
}

.matcher-sample-row.status-unmatched {
  border-left: 4px solid var(--accent-amber);
}

.matcher-sample-row.status-scanning {
  border-left: 4px solid #a855f7;
}

/* Left Column: Sample A Reference */
.matcher-sample-col {
  background: rgba(11, 15, 25, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  justify-content: space-between;
}

.matcher-sample-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.matcher-sample-index-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cyan);
  background: rgba(56, 189, 248, 0.15);
  border: 1px solid rgba(56, 189, 248, 0.35);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.matcher-status-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.matcher-status-badge.matched-2 {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.45);
}

.matcher-status-badge.matched-1 {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.45);
}

.matcher-status-badge.unmatched {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.45);
}

.matcher-status-badge.scanning {
  background: rgba(168, 85, 247, 0.2);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.45);
}

.matcher-sample-thumb-box {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(56, 189, 248, 0.25);
  cursor: pointer;
}

.matcher-sample-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.matcher-sample-thumb-box:hover img {
  transform: scale(1.05);
}

.matcher-sample-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.matcher-sample-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matcher-sample-sub {
  font-size: 0.72rem;
  color: var(--dim);
}

.matcher-sample-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.matcher-sample-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.matcher-btn-rescan-sample {
  flex: 1;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.matcher-btn-rescan-sample:hover {
  background: rgba(56, 189, 248, 0.28);
  border-color: #38bdf8;
  color: #fff;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.35);
}

.matcher-btn-clear-sample {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 0.78rem;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: var(--transition-smooth);
}

.matcher-btn-clear-sample:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fff;
}

/* Right / Main Column: Matched Candidate Cards */
.matcher-candidates-col {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.matcher-candidates-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  height: 100%;
}

.matcher-candidate-card {
  background: rgba(11, 15, 25, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: var(--transition-smooth);
  position: relative;
}

.matcher-candidate-card.is-selected {
  border-color: rgba(16, 185, 129, 0.75);
  background: rgba(16, 185, 129, 0.08);
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.2);
}

.matcher-candidate-card.not-selected {
  opacity: 0.75;
  border-color: rgba(255, 255, 255, 0.08);
}

.matcher-candidate-card.not-selected:hover {
  opacity: 1;
  border-color: rgba(255, 255, 255, 0.25);
}

.matcher-candidate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.matcher-candidate-radio-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.matcher-candidate-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--accent-green);
  cursor: pointer;
}

.matcher-candidate-slot-tag {
  font-size: 0.76rem;
  font-weight: 800;
  color: var(--white);
}

.matcher-candidate-card.is-selected .matcher-candidate-slot-tag {
  color: #34d399;
}

.matcher-candidate-badges {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.matcher-candidate-thumb-box {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.matcher-candidate-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.matcher-candidate-thumb-box:hover img {
  transform: scale(1.05);
}

.matcher-candidate-thumb-box .matcher-zoom-hover-cue {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.matcher-candidate-thumb-box:hover .matcher-zoom-hover-cue {
  opacity: 1;
}

.matcher-candidate-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.matcher-candidate-filename {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matcher-candidate-sub {
  font-size: 0.7rem;
  color: var(--dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.matcher-candidate-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
}

.matcher-btn-action {
  flex: 1;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--white);
  padding: 8px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.matcher-btn-action:hover {
  background: rgba(255, 255, 255, 0.18);
}

.matcher-btn-action.btn-compare:hover {
  border-color: rgba(56, 189, 248, 0.5);
  color: #38bdf8;
}

.matcher-btn-action.btn-delete-candidate {
  color: #fca5a5;
  border-color: rgba(244, 63, 94, 0.3);
}

.matcher-btn-action.btn-delete-candidate:hover {
  background: rgba(244, 63, 94, 0.2);
  border-color: #f43f5e;
  color: #fff;
}

/* Empty Secondary Slot (When only 1 match found) */
.matcher-candidate-card.candidate-slot-empty {
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(15, 23, 42, 0.35);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
}

.matcher-empty-slot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.matcher-empty-slot-icon {
  font-size: 1.8rem;
  color: var(--dim);
}

.matcher-empty-slot-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--dim);
}

.matcher-empty-slot-desc {
  font-size: 0.72rem;
  color: var(--dim);
  margin: 0;
  max-width: 220px;
}

.matcher-btn-action.btn-rescan-secondary {
  margin-top: 6px;
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.matcher-btn-action.btn-rescan-secondary:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
}

/* Empty Match State for a Sample (When 0 matches found) */
.matcher-no-match-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px dashed rgba(245, 158, 11, 0.35);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.matcher-no-match-icon {
  font-size: 2.2rem;
  color: #fbbf24;
  flex-shrink: 0;
}

.matcher-no-match-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.matcher-no-match-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--white);
  margin: 0;
}

.matcher-no-match-content p {
  font-size: 0.78rem;
  color: var(--dim);
  margin: 0;
}

.matcher-no-match-actions {
  margin-top: 6px;
}

/* Pulsing Scanning State for Single Sample Re-Scan */
.matcher-scanning-state-box {
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.matcher-scanning-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(168, 85, 247, 0.25);
  border-top-color: #c084fc;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.matcher-scanning-text strong {
  font-size: 0.9rem;
  color: #c084fc;
  display: block;
  margin-bottom: 4px;
}

.matcher-scanning-text p {
  font-size: 0.76rem;
  color: var(--dim);
  margin: 0;
}

/* Sample Card Action Grid (Fixed Reference Sample Controls) */
.matcher-sample-actions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.matcher-btn-sample-action {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  color: var(--white);
  padding: 8px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition-smooth);
}

.matcher-btn-sample-action:hover {
  background: rgba(255, 255, 255, 0.18);
  transform: translateY(-1px);
}

.matcher-btn-sample-action.btn-rescan-sample {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.matcher-btn-sample-action.btn-rescan-sample:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
  border-color: #38bdf8;
}

.matcher-btn-sample-action.btn-upload-sample-match {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
.matcher-btn-sample-action.btn-upload-sample-match:hover {
  background: rgba(16, 185, 129, 0.25);
  color: #fff;
  border-color: #10b981;
}

.matcher-btn-sample-action.btn-change-sample {
  color: #fef08a;
  border-color: rgba(234, 179, 8, 0.35);
}
.matcher-btn-sample-action.btn-change-sample:hover {
  background: rgba(234, 179, 8, 0.22);
  color: #fff;
  border-color: #eab308;
}

.matcher-btn-sample-action.btn-delete-sample {
  color: #fca5a5;
  border-color: rgba(244, 63, 94, 0.35);
}
.matcher-btn-sample-action.btn-delete-sample:hover {
  background: rgba(244, 63, 94, 0.22);
  color: #fff;
  border-color: #f43f5e;
}

/* Candidate Slot Tag Badges */
.matcher-candidate-slot-tag.tag-primary {
  background: rgba(16, 185, 129, 0.2);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.matcher-candidate-slot-tag.tag-alt {
  background: rgba(168, 85, 247, 0.18);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Candidate Card Primary Promotion Button */
.matcher-btn-action.btn-make-primary {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.45);
  color: #34d399;
  font-weight: 700;
}
.matcher-btn-action.btn-make-primary:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #fff;
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
}

.matcher-btn-action.btn-upload-replacement,
.matcher-btn-action.btn-upload-secondary {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
.matcher-btn-action.btn-upload-replacement:hover,
.matcher-btn-action.btn-upload-secondary:hover {
  background: rgba(56, 189, 248, 0.25);
  color: #fff;
  border-color: #38bdf8;
}

/* Direct Upload Button for Empty Match State */
.matcher-btn-upload-match {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.5);
  border-radius: 6px;
  color: #34d399;
  padding: 8px 16px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition-smooth);
}
.matcher-btn-upload-match:hover {
  background: rgba(16, 185, 129, 0.3);
  color: #fff;
  border-color: #10b981;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   Comprehensive Mobile & Small Screen Optimization (< 768px)
   Apple Human Interface & Android Material Touch Guidelines
   ========================================================================== */

@media (max-width: 768px) {
  /* Prevent iOS Safari auto-zoom by enforcing 16px base font on inputs */
  .matcher-select,
  .matcher-input,
  #matcher-input-search,
  #matcher-filter-sample,
  #matcher-select-sort,
  #matcher-select-mode,
  #matcher-select-criteria,
  #matcher-select-direction,
  #matcher-select-output-org,
  #matcher-select-collision,
  #matcher-select-dump-side {
    font-size: 16px !important;
    min-height: 44px;
    box-sizing: border-box;
  }

  /* Universal Touch Targets (min 44px) & Fast Response */
  .matcher-btn-action,
  .matcher-btn-sample-action,
  .matcher-btn-upload-match,
  .matcher-btn-rescan-sample,
  .matcher-btn-clear-sample,
  .matcher-candidate-radio-label,
  .matcher-start-btn,
  .matcher-folder-card .btn,
  .matcher-results-actions .btn {
    min-height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* Stepper Bar */
  .matcher-pipeline-stepper {
    flex-direction: column;
    align-items: stretch;
    padding: 14px 16px;
    gap: 10px;
    margin-bottom: 16px;
  }

  .matcher-step-item {
    width: 100%;
    gap: 10px;
  }

  .matcher-step-badge {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .matcher-step-arrow {
    display: none;
  }

  /* 3-Folder Ingestion Cards */
  .matcher-folders-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    margin-bottom: 16px;
  }

  .matcher-folder-card {
    padding: 16px 14px;
    border-radius: var(--radius-md);
  }

  .matcher-card-header {
    margin-bottom: 10px;
  }

  .matcher-card-icon {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .matcher-card-title {
    font-size: 1rem;
  }

  .matcher-dropzone {
    padding: 16px 12px;
    margin-bottom: 12px;
  }

  .matcher-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    width: 100%;
  }

  .matcher-card-actions .btn {
    flex: 1 1 calc(50% - 8px);
    min-height: 44px;
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .matcher-card-actions button[id^="matcher-btn-clear"] {
    flex: 0 0 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    min-height: 44px;
  }

  /* Folder A Reference Sample Thumbnail Strip */
  .matcher-samples-strip {
    padding: 6px 2px 10px 2px;
    min-height: 64px;
    -webkit-overflow-scrolling: touch;
  }

  .matcher-sample-thumb-card {
    width: 58px;
    height: 58px;
  }

  .matcher-sample-remove-btn {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  #matcher-btn-assign-all-lh,
  #matcher-btn-assign-all-rh,
  #matcher-btn-assign-all-both {
    min-height: 34px;
    padding: 4px 8px !important;
    font-size: 0.72rem !important;
  }

  /* Configuration Panel */
  .matcher-config-panel {
    padding: 16px 14px;
    margin-bottom: 16px;
    border-radius: var(--radius-md);
  }

  .matcher-config-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
    margin-bottom: 14px;
  }

  .matcher-config-field {
    grid-column: span 1 !important;
  }

  .matcher-preset-pills {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-top: 8px;
  }

  .matcher-preset-pill {
    min-height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.78rem;
    padding: 6px 8px;
  }

  /* Master Action Bar */
  .matcher-master-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding-top: 14px;
  }

  .matcher-master-actions > div:first-child {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .matcher-start-btn {
    width: 100%;
    min-height: 48px;
    justify-content: center;
    font-size: 1rem;
  }

  #matcher-btn-pause,
  #matcher-btn-cancel {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  /* Live Progress Container */
  .matcher-progress-container {
    padding: 16px 14px;
    margin-bottom: 16px;
  }

  .matcher-metrics-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .matcher-metric-item {
    font-size: 0.76rem;
    background: rgba(0, 0, 0, 0.3);
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    justify-content: space-between;
  }

  /* Results Section Banner & Actions */
  .matcher-results-banner {
    padding: 16px 14px;
    margin-bottom: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .matcher-results-title-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .matcher-results-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
  }

  #matcher-btn-cognitive-verify,
  #matcher-btn-copy-disk,
  #matcher-btn-download-zip,
  #matcher-btn-clear-results {
    grid-column: span 2;
    width: 100% !important;
    min-height: 46px;
    justify-content: center;
    font-size: 0.88rem;
  }

  #matcher-btn-export-csv,
  #matcher-btn-export-json {
    grid-column: span 1;
    width: 100% !important;
    min-height: 44px;
    justify-content: center;
    font-size: 0.82rem;
  }

  /* Filter & Search Toolbar */
  .matcher-toolbar {
    padding: 12px 14px;
    margin-bottom: 14px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .matcher-toolbar-left {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-width: 0;
  }

  .matcher-btn-icon-sm {
    min-height: 38px;
    padding: 6px 14px;
    font-size: 0.82rem;
  }

  .matcher-toolbar-right {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  #matcher-input-search,
  #matcher-filter-sample,
  #matcher-select-sort {
    max-width: 100% !important;
    width: 100% !important;
    min-height: 44px;
  }

  /* Sample Rows & Candidate Grid */
  .matcher-sample-row {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
  }

  .matcher-sample-col {
    padding: 12px;
    border-radius: var(--radius-sm);
  }

  .matcher-sample-thumb-box {
    aspect-ratio: 16 / 10;
    max-height: 220px;
    width: 100%;
  }

  .matcher-sample-actions-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 10px;
  }

  .matcher-sample-actions-grid button {
    min-height: 44px;
    font-size: 0.82rem;
  }

  .matcher-candidates-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .matcher-candidate-card {
    padding: 12px;
  }

  .matcher-candidate-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .matcher-candidate-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }

  .matcher-candidate-thumb-box {
    aspect-ratio: 16 / 10;
    max-height: 220px;
    width: 100%;
  }

  .matcher-candidate-filename {
    word-break: break-all;
    white-space: normal;
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .matcher-candidate-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
  }

  .matcher-candidate-actions .btn-make-primary,
  .matcher-candidate-actions .btn-upload-replacement {
    grid-column: span 2;
    min-height: 44px;
    font-size: 0.85rem;
    justify-content: center;
  }

  .matcher-candidate-actions .btn-compare,
  .matcher-candidate-actions .btn-delete-candidate {
    min-height: 44px;
    font-size: 0.82rem;
    justify-content: center;
  }

  /* Empty States */
  .candidate-slot-empty {
    padding: 18px 12px !important;
  }

  .candidate-slot-empty .matcher-empty-slot-content > div {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .candidate-slot-empty .matcher-empty-slot-content button {
    width: 100%;
    min-height: 44px;
  }

  .matcher-no-match-box {
    flex-direction: column;
    text-align: center;
    padding: 16px 14px;
    gap: 10px;
  }

  .matcher-no-match-actions {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }

  .matcher-no-match-actions button {
    width: 100%;
    min-height: 44px;
  }

  .matcher-scanning-state-box {
    flex-direction: column;
    text-align: center;
    padding: 18px 14px;
  }

  /* Comparison Modal */
  .matcher-modal-backdrop {
    padding: 6px;
  }

  .matcher-modal-window {
    max-height: 98vh;
    border-radius: var(--radius-md);
  }

  .matcher-modal-header {
    padding: 12px 14px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .matcher-modal-title {
    font-size: 0.95rem;
  }

  .matcher-modal-body {
    padding: 12px;
  }

  .matcher-compare-views-container {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .matcher-compare-img-wrap {
    aspect-ratio: 4 / 3;
    max-height: 250px;
  }

  .matcher-curtain-container {
    aspect-ratio: 4 / 3;
    max-height: 250px;
  }

  /* Modal Metrics Table on Mobile */
  .matcher-metrics-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.76rem;
  }

  .matcher-metrics-table th,
  .matcher-metrics-table td {
    padding: 6px 8px;
  }
}

/* Extra Small Phones (< 400px) */
@media (max-width: 400px) {
  .matcher-preset-pills {
    grid-template-columns: 1fr;
  }

  .matcher-metrics-row {
    grid-template-columns: 1fr;
  }

  .matcher-sample-actions-grid {
    grid-template-columns: 1fr;
  }
}

/* =========================================================================
   Live Folder Upload & Ingestion Progress System
   ========================================================================= */
.matcher-upload-progress-box {
  background: rgba(10, 16, 28, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.35);
  animation: matcherFadeIn 0.25s ease-out;
}

.card-folder-b .matcher-upload-progress-box {
  border-color: rgba(245, 158, 11, 0.35);
}

.matcher-upload-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.matcher-upload-progress-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--white);
  display: flex;
  align-items: center;
  gap: 6px;
}

.matcher-upload-progress-pct {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--cyan);
  font-family: var(--font-mono);
  background: rgba(56, 189, 248, 0.12);
  padding: 1px 6px;
  border-radius: 4px;
}

.card-folder-b .matcher-upload-progress-pct {
  color: var(--accent-amber);
  background: rgba(245, 158, 11, 0.12);
}

.matcher-upload-progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
  position: relative;
}

.matcher-upload-progress-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.15s ease-out;
  position: relative;
}

.matcher-upload-progress-bar.bar-cyan {
  background: linear-gradient(90deg, #0284c7, #38bdf8, #00f0ff);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.6);
}

.matcher-upload-progress-bar.bar-amber {
  background: linear-gradient(90deg, #d97706, #fbbf24, #fef08a);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
}

.matcher-upload-progress-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.matcher-upload-progress-currfile {
  font-size: 0.7rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
  font-family: var(--font-mono);
}



