/* Mobile Dedicated Styles for amazon-white */
:root {
  --primary: #f59e0b;
}

.m-app-container {
  padding: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}

.m-hero {
  text-align: center;
  padding: 0.75rem 0.5rem;
}
.m-hero h1 {
  font-size: 1.3rem;
  font-weight: 800;
  color: #0f172a;
}
.m-hero .highlight {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 4px;
  display: block;
}

.m-audit-workspace {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

/* Mobile Unified Operations Card (Clean Light Aesthetic) */
.m-audit-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.9rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.m-audit-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.score-badge-circle {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 900;
  background: #ecfdf5;
  border: 2.5px solid #10b981;
  color: #047857;
  flex-shrink: 0;
}
.score-badge-circle.warn {
  background: #fffbeb;
  border-color: #f59e0b;
  color: #b45309;
}
.score-badge-circle.fail {
  background: #fef2f2;
  border-color: #ef4444;
  color: #b91c1c;
}

.m-audit-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.m-audit-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.m-audit-title-row h3 {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
}

.m-audit-meta p {
  font-size: 0.74rem;
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}

.compliance-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
}
.compliance-tag.pass {
  background: #d1fae5;
  color: #047857;
}
.compliance-tag.warn {
  background: #fef3c7;
  color: #b45309;
}
.compliance-tag.fail {
  background: #fee2e2;
  color: #b91c1c;
}

/* Action Buttons Row */
.m-action-row {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
}

.m-action-row .btn-primary-action {
  flex: 1.25;
  background: #0f172a;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 0.62rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
}

.m-action-row .btn-export-action {
  flex: 1.25;
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 10px;
  padding: 0.62rem 0.65rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}
.m-action-row .btn-export-action:active {
  background: #f8fafc;
  transform: scale(0.99);
}

.m-action-row .btn-secondary-action {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 5 Dimensions Compact 2-Column Grid */
.m-capsules-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  width: 100%;
}

.m-capsules-grid .capsule-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 6px 9px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-height: 48px;
  min-width: 0;
  overflow: hidden;
  transition: all 0.18s ease;
}

.m-capsules-grid .capsule-pill.pass {
  border-color: #a7f3d0;
  background: #f0fdf4;
}
.m-capsules-grid .capsule-pill.warn {
  border-color: #fde68a;
  background: #fffdf5;
}
.m-capsules-grid .capsule-pill.fail {
  border-color: #fecaca;
  background: #fff5f5;
}

.m-capsules-grid .capsule-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.m-capsules-grid .capsule-pill.pass .capsule-label { color: #065f46; }
.m-capsules-grid .capsule-pill.warn .capsule-label { color: #92400e; }
.m-capsules-grid .capsule-pill.fail .capsule-label { color: #991b1b; }

.m-capsules-grid .capsule-val {
  font-size: 0.70rem;
  font-weight: 700;
  color: #64748b;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.m-capsules-grid .capsule-pill.pass .capsule-val { color: #047857; }
.m-capsules-grid .capsule-pill.warn .capsule-val { color: #b45309; }
.m-capsules-grid .capsule-pill.fail .capsule-val { color: #b91c1c; }

/* Mobile AI Scan Sweep Showcase (Ultra-lightweight GPU CSS) */
.ai-scan-stage {
  position: relative;
  width: 100% !important;
  max-width: 350px !important;
  aspect-ratio: 1 / 1 !important;
  margin: 0 auto 0.75rem auto;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  user-select: none;
  background: #ffffff;
  cursor: pointer;
}
.ai-scan-stage.is-draggable,
.ba-slider-stage.is-draggable,
#baSliderContainer.is-draggable,
.ba-slider-stage.finished-mode,
#baSliderContainer.finished-mode {
  cursor: grab !important;
}
.ai-scan-stage.is-dragging,
.ba-slider-stage.is-dragging,
#baSliderContainer.is-dragging {
  cursor: grabbing !important;
}

.stage-control-bar {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 6px;
}
.stage-ctrl-btn {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  padding: 0;
}
.stage-ctrl-btn:active {
  transform: scale(0.94);
}

.ai-scan-clean-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background: #ffffff;
}
.ai-scan-clean-layer canvas, .ai-scan-clean-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ai-scan-text-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 2;
  animation: aiWhiteWipe 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: clip-path, opacity;
}
.ai-scan-text-layer canvas, .ai-scan-text-layer img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.ai-scan-beam {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 3px;
  background: #ffffff;
  z-index: 5;
  pointer-events: none;
  animation: aiWhiteBeamSweep 5.5s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  will-change: left, opacity;
  box-shadow: 
    0 0 8px 2px #fbbf24,
    0 0 20px 4px rgba(245, 158, 11, 0.9);
}

.ai-scan-beam-glow {
  position: absolute;
  top: 0;
  bottom: 0;
  right: 100%;
  width: 60px;
  background: linear-gradient(to left, rgba(245, 158, 11, 0.4), transparent);
  pointer-events: none;
}

@keyframes aiDotPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.6; }
}

@keyframes aiWhiteWipe {
  0%, 15% { clip-path: inset(0 0 0 0); opacity: 1; }
  45% { clip-path: inset(0 0 0 100%); opacity: 1; }
  75% { clip-path: inset(0 0 0 100%); opacity: 1; }
  85% { clip-path: inset(0 0 0 100%); opacity: 0; }
  90% { clip-path: inset(0 0 0 0); opacity: 0; }
  96%, 100% { clip-path: inset(0 0 0 0); opacity: 1; }
}

@keyframes aiWhiteBeamSweep {
  0%, 14% { left: 0%; opacity: 0; }
  15% { left: 0%; opacity: 1; }
  45% { left: 100%; opacity: 1; }
  48%, 100% { left: 100%; opacity: 0; }
}

.canvas-floating-upload {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 25;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: auto;
  max-width: 86%;
  pointer-events: auto;
}
.btn-cutout-minimal {
  position: relative;
  overflow: hidden;
  padding: 7px 18px;
  border-radius: 9999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.8rem;
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.16);
  width: auto;
  white-space: nowrap;
  border: 1px solid rgba(0, 0, 0, 0.08);
}
.btn-upload-svg {
  width: 14px;
  height: 14px;
  stroke: #f59e0b;
  flex-shrink: 0;
}

/* In-Canvas Processing Overlay */
.canvas-processing-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #ffffff;
  padding: 1.25rem;
  text-align: center;
  border-radius: inherit;
  pointer-events: auto;
  user-select: none;
}

.processing-spinner {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #f59e0b;
  border-radius: 50%;
  animation: amzSpinnerSpin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

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

.processing-title {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.processing-tip {
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
  max-width: 260px;
  line-height: 1.4;
}

/* Dedicated Upload Action Row Below Demo Showcase */
.m-stage-upload-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0.85rem auto 0.5rem auto;
  width: 100%;
  max-width: 350px;
}

.m-stage-upload-row.is-hidden,
#canvasFloatingUpload[style*="display: none"],
#canvasFloatingUpload[style*="display:none"] {
  display: none !important;
}

.m-btn-upload-primary {
  width: 100% !important;
  height: 46px !important;
  min-height: 46px !important;
  background: #0f172a !important;
  color: #ffffff !important;
  border: 1px solid #0f172a !important;
  border-radius: 10px !important;
  font-size: 0.92rem !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  cursor: pointer !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
  transition: all 0.15s ease !important;
  -webkit-tap-highlight-color: transparent !important;
}

.m-btn-upload-primary:active {
  transform: scale(0.99) !important;
  background: #1e293b !important;
}

.m-upload-hint {
  font-size: 0.72rem !important;
  color: #94a3b8 !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
}
