/* ═══════════ DESIGN SYSTEM ═══════════ */
*{margin:0;padding:0;box-sizing:border-box}
:root{
  --navy:#0f1b2d;--navy-light:#1a2d47;--gold:#c9a96e;--gold-light:#e0c992;
  --gold-dark:#a88a4e;--emerald:#10b981;--coral:#ef4444;
  --surface:#faf9f7;--card:#ffffff;--border:rgba(0,0,0,.08);
  --text:#1a1a2e;--text-muted:#7a7a8e;--text-faint:#b0b0be;
  --radius:16px;--radius-sm:10px;--radius-xs:6px;
  --shadow-sm:0 1px 3px rgba(0,0,0,.06);--shadow-md:0 8px 24px rgba(0,0,0,.08);
  --shadow-lg:0 16px 48px rgba(0,0,0,.12);--shadow-glow:0 0 0 0 rgba(201,169,110,.5);
  --ease:cubic-bezier(.4,0,.2,1);--bounce:cubic-bezier(.175,.885,.32,1.275);
}
body{font-family:'Inter',system-ui,sans-serif;background:var(--surface);min-height:100vh;color:var(--text);-webkit-font-smoothing:antialiased}
.bg-grain{position:fixed;inset:0;opacity:.03;pointer-events:none;background:url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E")}

/* ═══════════ APP SHELL ═══════════ */
.app-shell{max-width:1100px;margin:0 auto;padding:1rem}
.nav-bar{display:flex;align-items:center;justify-content:space-between;padding:.75rem 1.5rem;background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow-sm);margin-bottom:1.5rem}
.nav-brand{display:flex;align-items:center;gap:.4rem}
.brand-logo{height:22px;width:auto;display:block;transition:all .3s var(--ease);mix-blend-mode:multiply}
.brand-logo:hover{opacity:.8}
.brand-info{display:flex;flex-direction:column;gap:0}
.brand-text{font-family:'Inter',sans-serif;font-weight:700;font-size:.95rem;letter-spacing:.02em;color:var(--navy);line-height:1.1}
.nav-tagline{font-size:.55rem;color:var(--gold);font-weight:700;letter-spacing:.05em;text-transform:uppercase;opacity:.8}

/* ═══════════ MAIN CONTENT ═══════════ */
.main-content{background:var(--card);border-radius:var(--radius);box-shadow:var(--shadow-md);padding:2.5rem;overflow:hidden}
.step-section{animation:fadeUp .5s var(--ease)}
@keyframes fadeUp{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}

/* Section Headers */
.section-header{text-align:center;margin-bottom:2.5rem}
.step-chip{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;background:var(--navy);color:var(--gold);font-size:.75rem;font-weight:700;border-radius:50%;margin-bottom:1rem}
.section-title{font-family:'Playfair Display',serif;font-size:2rem;font-weight:700;color:var(--navy);margin-bottom:.5rem}
.section-subtitle{color:var(--text-muted);font-size:.95rem;max-width:500px;margin:0 auto}

/* ═══════════ HERO SECTION ═══════════ */
.hero-section {
  background-color: #F6F4EF;
  padding: 4rem 3rem;
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -2.5rem -2.5rem 2rem -2.5rem;
}
.hero-content {
  max-width: 800px;
}
.hero-title {
  font-family: 'Inter', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 0.2rem;
  line-height: 1.2;
}
.hero-subtitle {
  font-family: 'Inter', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  color: #1A1A1A;
  margin-bottom: 1rem;
  line-height: 1.2;
}
.hero-description {
  font-size: 1rem;
  color: #666;
  line-height: 1.5;
  max-width: 90%;
}
.btn-find-matches {
  background-color: #797979;
  color: white;
  border: none;
  padding: 1rem 1.5rem;
  font-size: 1rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: background-color 0.2s;
}
.btn-find-matches:hover {
  background-color: #666666;
}

/* ═══════════ HOW IT WORKS ═══════════ */
.how-it-works-section {
  text-align: center;
  margin-bottom: 3rem;
}
.how-it-works-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #333;
  letter-spacing: 0.05em;
  margin-bottom: 2rem;
}
.steps-container {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  max-width: 900px;
  margin: 0 auto;
}
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  text-align: left;
  flex: 1;
}
.step-number {
  width: 28px;
  height: 28px;
  background-color: #F97316;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.step-text h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 0.3rem;
}
.step-text p {
  font-size: 0.85rem;
  color: #888;
  line-height: 1.4;
}

/* ═══════════ AI VISUALIZER HISTORY ═══════════ */
.history-section {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
  border-top: 1px solid #E5E7EB;
  border-bottom: 1px solid #E5E7EB;
}
.history-section.hidden { display: none !important; }
.history-info {
  flex-shrink: 0;
  min-width: 160px;
}
.history-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 0.2rem;
  font-family: 'Inter', sans-serif;
}
.history-subtitle {
  font-size: 0.8rem;
  color: #9CA3AF;
  font-weight: 400;
}
.history-grid {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  flex: 1;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: #E5E7EB transparent;
}
.history-grid::-webkit-scrollbar { height: 4px; }
.history-grid::-webkit-scrollbar-thumb { background: #E5E7EB; border-radius: 4px; }
.history-item {
  flex-shrink: 0;
  width: 140px;
  height: 90px;
  border-radius: 2px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  position: relative;
}
.history-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.history-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.history-item::after {
  content: attr(title);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: white;
  font-size: 0.6rem;
  padding: 0.75rem 0.4rem 0.3rem;
  opacity: 0;
  transition: opacity 0.2s;
}
.history-item:hover::after { opacity: 1; }

/* ═══════════ UPLOAD ZONE ═══════════ */
.upload-zone {
  border: 1px dashed #D1D5DB;
  background-color: #F9FAFB;
  border-radius: var(--radius-xs);
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  margin-bottom: 2rem;
}
.upload-zone:hover, .upload-zone.drag-over {
  border-color: #9CA3AF;
  background-color: #F3F4F6;
}
.upload-icon-circle {
  width: 56px;
  height: 56px;
  background-color: #E5E7EB;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
}
.upload-icon-circle svg {
  width: 24px;
  height: 24px;
  color: #4B5563;
}
.upload-title {
  font-size: 1.1rem;
  font-weight: 500;
  color: #111827;
  margin-bottom: 0.5rem;
}
.upload-subtitle {
  font-size: 0.85rem;
  color: #9CA3AF;
  margin-bottom: 1.5rem;
}
.btn-browse {
  background-color: transparent;
  color: #1D4ED8;
  border: 1px solid #1D4ED8;
  padding: 0.6rem 2rem;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-browse:hover {
  background-color: #EFF6FF;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  margin: 2rem 0;
  color: #9CA3AF;
  font-size: 0.85rem;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #E5E7EB;
}
.divider span {
  padding: 0 1rem;
}

/* Camera Upload Zone */
.camera-upload-zone {
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-xs);
  padding: 1.5rem;
  text-align: center;
  background-color: white;
  cursor: pointer;
  transition: border-color 0.2s;
}
.camera-upload-zone:hover {
  border-color: #D1D5DB;
}
.camera-upload-zone h4 {
  font-size: 0.95rem;
  font-weight: 600;
  color: #111827;
  margin-bottom: 0.25rem;
}
.camera-upload-zone p {
  font-size: 0.85rem;
  color: #6B7280;
}

/* Preview */
.preview-wrap{margin-top:2rem;text-align:center;position:relative;display:inline-block;width:100%}
.preview-wrap img{max-width:100%;max-height:420px;border-radius:var(--radius);box-shadow:var(--shadow-lg)}
.btn-change{position:absolute;top:.75rem;right:.75rem;background:rgba(255,255,255,.95);backdrop-filter:blur(10px);border:1px solid var(--border);padding:.45rem .9rem;border-radius:var(--radius-xs);font-weight:600;font-size:.8rem;cursor:pointer;display:flex;align-items:center;gap:.35rem;transition:all .2s}
.btn-change:hover{background:#fff;box-shadow:var(--shadow-sm)}

/* Primary Button */
.btn-primary-full{width:100%;background:linear-gradient(135deg,var(--navy),var(--navy-light));color:#fff;border:none;padding:1rem 2rem;border-radius:var(--radius-sm);font-size:1rem;font-weight:600;cursor:pointer;margin-top:2rem;transition:all .3s var(--ease);display:flex;align-items:center;justify-content:center;gap:.5rem;font-family:inherit}
.btn-primary-full:hover:not(:disabled){transform:translateY(-2px);box-shadow:0 8px 20px rgba(15,27,45,.25)}
.btn-primary-full:disabled{opacity:.4;cursor:not-allowed}

/* ═══════════ LOADER / ANALYSIS ═══════════ */
.analysis-container {
  max-width: 600px;
  margin: 2rem auto;
  text-align: center;
  font-family: 'Inter', sans-serif;
  color: #1A1A1A;
}
.analysis-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.analysis-subtitle {
  font-size: 0.9rem;
  color: #6B7280;
  margin-bottom: 1.5rem;
}
.analysis-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: #4B5563;
}
.analysis-status-text {
  font-size: 0.9rem;
  color: #6B7280;
  margin-bottom: 2rem;
}
.analysis-steps {
  border: 1px solid #E5E7EB;
  border-radius: var(--radius-xs);
  text-align: left;
  margin-bottom: 1rem;
}
.analysis-step {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #E5E7EB;
  font-size: 0.9rem;
  color: #4B5563;
}
.analysis-step:last-child {
  border-bottom: none;
}
.analysis-step.done {
  color: #9CA3AF;
}
.analysis-step.active {
  background-color: #F9FAFB;
  color: #111827;
}
.step-circle {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #D1D5DB;
  margin-right: 1rem;
  flex-shrink: 0;
}
.step-circle.filled {
  background-color: #1D4ED8; /* Dark blue */
  border-color: #1D4ED8;
  position: relative;
}
.step-circle.filled::after {
  content: '';
  position: absolute;
  top: 4px;
  left: 4px;
  width: 4px;
  height: 4px;
  background-color: white;
  border-radius: 50%;
}
.step-circle.border {
  border-color: #1D4ED8;
  border-width: 2px;
}
.step-label {
  flex: 1;
}
.step-label strong {
  font-weight: 600;
}
.step-badge {
  background-color: #E5E7EB;
  color: #4B5563;
  font-size: 0.75rem;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-weight: 500;
  white-space: nowrap;
}
.analysis-step.active .step-circle.border {
  animation: stepPulse 1.4s ease-in-out infinite;
}
@keyframes stepPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29,78,216,0.4); }
  50%       { box-shadow: 0 0 0 5px rgba(29,78,216,0); }
}
.progress-bar-container {
  margin-bottom: 1.5rem;
}
.progress-bar-track {
  height: 4px;
  background-color: #E5E7EB;
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.progress-bar-fill {
  height: 100%;
  background-color: #1D4ED8;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 2px;
}
.progress-percentage {
  text-align: right;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1D4ED8;
}
.live-update-text {
  font-size: 0.8rem;
  color: #9CA3AF;
  margin-bottom: 0.5rem;
}
.proceed-link {
  font-size: 0.85rem;
  color: #9CA3AF;
  text-decoration: underline;
}
.proceed-link:hover {
  color: #4B5563;
}

/* ═══════════ RESULTS TOPBAR ═══════════ */
.results-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background: white;
  border-bottom: 1px solid #E5E7EB;
  margin: -2.5rem -2.5rem 1rem -2.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar-selections {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.topbar-no-selection {
  font-size: 0.82rem;
  color: #9CA3AF;
  font-style: italic;
}
.topbar-tile-thumb {
  width: 28px;
  height: 28px;
  object-fit: cover;
  border-radius: 3px;
  border: 1px solid #E5E7EB;
  flex-shrink: 0;
}
.topbar-selection {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.selection-label {
  font-size: 0.65rem;
  font-weight: 600;
  color: #9CA3AF;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.selection-value {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: #1A1A1A;
}
.color-block {
  width: 16px;
  height: 16px;
  border-radius: 2px;
}
.btn-visualize-top {
  background-color: #8D8D8D;
  color: white;
  border: none;
  padding: 0.6rem 1.5rem;
  font-size: 0.85rem;
  font-weight: 500;
  border-radius: 2px;
  cursor: pointer;
  transition: background-color 0.2s;
  margin-left: 1rem;
}
.btn-visualize-top:hover {
  background-color: #6B7280;
}
.btn-ghost:hover{border-color:var(--navy);color:var(--navy)}

/* Canvas Container */
.canvas-container{position:relative;margin-bottom:1.5rem}
.canvas-hint{display:flex;align-items:center;gap:.5rem;background:linear-gradient(135deg,rgba(201,169,110,.08),rgba(201,169,110,.03));border:1px solid rgba(201,169,110,.2);padding:.6rem 1rem;border-radius:var(--radius-xs);font-size:.8rem;color:var(--gold-dark);margin-bottom:1rem;font-weight:500}
#interactive-overlays{position:absolute;top:0;left:0;width:100%;height:100%;pointer-events:none;z-index:20}

/* ═══════════ MAIN VIEWPORT ═══════════ */
.main-view-container{position:relative;width:100%;min-height:auto;border-radius:var(--radius);overflow:hidden;background:transparent;display:flex;justify-content:center;align-items:center}
.selection-view,.visualization-view{width:100%;height:auto;transition:all .5s var(--ease);display:flex;justify-content:center;align-items:center}
.selection-view.hidden,.visualization-view.hidden{display:none}

.analyzed-image-wrapper{position:relative;display:inline-block;width:100%;max-width:100%;border-radius:var(--radius);box-shadow:var(--shadow-lg);overflow:hidden;}
.analyzed-image-wrapper > img{display:block;width:100%;height:auto;max-height:75vh;object-fit:contain;border-radius:var(--radius);}

/* ═══════════ COMPARISON SLIDER ═══════════ */
.comparison-container{position:relative;display:inline-block;width:100%;max-width:100%;height:auto;overflow:hidden;cursor:ew-resize;user-select:none;box-shadow:var(--shadow-lg);border-radius:var(--radius-sm)}
.comparison-img.original{display:block;line-height:0}
.comparison-img.original img{display:block;width:100%;height:auto;max-height:75vh;object-fit:contain}
.comparison-img.generated{position:absolute;top:0;left:0;width:50%;height:100%;overflow:hidden;z-index:2;line-height:0;border-right:1px solid rgba(255,255,255,.4)}
.comparison-img.generated img{display:block;height:100%;width:auto;max-width:none;object-fit:cover;object-position:left top}
.comparison-slider{position:absolute;top:0;bottom:0;left:50%;transform:translateX(-50%);width:40px;cursor:ew-resize;z-index:20;display:flex;align-items:center;justify-content:center}
.slider-line{position:absolute;top:0;bottom:0;left:50%;width:2px;background:#fff;transform:translateX(-50%);box-shadow:0 0 10px rgba(0,0,0,.5)}
.slider-button{position:relative;width:40px;height:40px;background:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 6px rgba(0,0,0,.3);color:#1A1A1A;}
.comparison-label{position:absolute;bottom:1.5rem;padding:.4rem 1rem;background:rgba(15,27,45,.7);color:#fff;font-size:.8rem;font-weight:600;border-radius:var(--radius-xs);backdrop-filter:blur(4px);z-index:10;pointer-events:none}
.comparison-label.before{left:1.5rem}
.comparison-label.after{right:1.5rem}

.viz-loading-overlay{position:absolute;inset:0;background:rgba(255,255,255,0.9);z-index:30;display:flex;flex-direction:column;align-items:center;justify-content:center;font-weight:500;color:#1A1A1A}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.6}}

/* ═══════════ HOTSPOT MARKERS ═══════════ */
.hotspot{position:absolute;width:40px;height:40px;background:rgba(255,255,255,0.4);border-radius:50%;cursor:pointer;pointer-events:auto;display:flex;align-items:center;justify-content:center;z-index:100;transform:translate(-50%,-50%);transition:all .3s var(--bounce);border:none;box-shadow:none;}
.hotspot::before{content:none;}
.hotspot::after{content:'';position:absolute;width:18px;height:18px;background:#fff;border-radius:50%;box-shadow:0 2px 8px rgba(0,0,0,.2);transition:transform 0.2s;pointer-events:none;opacity:1;bottom:auto;left:50%;top:50%;transform:translate(-50%,-50%);padding:0;color:transparent;white-space:nowrap;font-size:0;}
.hotspot:hover{transform:translate(-50%,-50%) scale(1.1);background:rgba(255,255,255,0.6);}
.hotspot:hover::after{transform:translate(-50%,-50%) scale(1.1);opacity:1;bottom:auto;}
.hotspot.pulse{animation:markerPulse 2s infinite}
@keyframes markerPulse{0%{box-shadow:0 0 0 0 rgba(255,255,255,.6)}70%{box-shadow:0 0 0 16px rgba(255,255,255,0)}100%{box-shadow:0 0 0 0 rgba(255,255,255,0)}}
.hotspot.selected{background:rgba(255,255,255,0.6);animation:none;transform:translate(-50%,-50%) scale(1.05)}

/* ═══════════ SUGGESTION POPUP ═══════════ */
.suggestion-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 460px;
    height: auto;
    max-height: 85vh;
    background: #ffffff;
    box-shadow: var(--shadow-lg);
    border-radius: 12px;
    border: 1px solid #E5E7EB;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    font-family: 'Inter', sans-serif;
    animation: modalFadeIn 0.3s var(--ease);
}
@keyframes modalFadeIn {
    from { opacity: 0; transform: translate(-50%, -45%); }
    to   { opacity: 1; transform: translate(-50%, -50%); }
}
.popup-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 27, 45, 0.55);
    backdrop-filter: blur(4px);
    z-index: 1999;
    animation: fadeIn 0.2s ease;
}
.popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #F3F4F6;
    margin-bottom: 0.75rem;
}
.popup-header h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}
.popup-close {
    background: #F3F4F6;
    color: #4B5563;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    font-weight: bold;
    line-height: 1;
    transition: all 0.2s;
}
.popup-close:hover {
    background: #E5E7EB;
    color: #111827;
}
.popup-body {
    flex: 1;
    overflow-y: auto;
    padding-right: 0.15rem;
}
.popup-body::-webkit-scrollbar {
    width: 4px;
}
.popup-body::-webkit-scrollbar-thumb {
    background: #E5E7EB;
    border-radius: 4px;
}
.match-row {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0.75rem;
    background: #ffffff;
}
.match-row:hover {
    border-color: #9CA3AF;
}
.match-row.active {
    border: 2px solid #8D8D8D;
    background: #F3F4F6;
}
.match-row-thumb {
    max-width: 120px;
    max-height: 120px;
    min-width: 0; /* allow shrink based on image */
    min-height: 0;
    flex-shrink: 0;
    overflow: hidden;
    background: #F3F4F6;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.match-row-thumb img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}
.match-row-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.match-row-name {
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #111827;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.match-row-desc {
    font-size: 0.8rem;
    color: #6B7280;
    margin: 0 0 0.2rem 0;
}
.match-row-score-text {
    display: inline-block;
    align-self: flex-start;
    padding: 0.2rem 0.5rem;
    background: #F3F4F6;
    color: #4B5563;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 2px;
    line-height: 1;
}
.match-row-score-badge {
    display: inline-block;
    align-self: flex-start;
    padding: 0.2rem 0.5rem;
    background: #00249c;
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 2px;
    line-height: 1;
}
.popup-scroll-indicator {
    text-align: center;
    padding: 0.5rem 0;
    font-size: 0.8rem;
    color: #9CA3AF;
    border-bottom: 1px solid #F3F4F6;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}
.popup-search-container {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.popup-search-label {
    font-size: 0.75rem;
    color: #374151;
    font-weight: 500;
    line-height: 1.4;
}
.popup-search-input-wrapper {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.popup-search-input {
    flex: 1;
    padding: 0.6rem 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.85rem;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s;
}
.popup-search-input:focus {
    border-color: #9CA3AF;
}
.btn-search {
    background: #8D8D8D;
    color: #ffffff;
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 90px;
}
.btn-search:hover {
    background: #6B7280;
}
.btn-reset-original {
    background: transparent;
    border: 1px solid #D1D5DB;
    color: #6B7280;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
}

/* Popup Footer */
.popup-footer{padding:1rem 2rem;border-top:1px solid var(--border);display:flex;justify-content:flex-end;background:var(--surface)}
.btn-confirm{background:var(--navy);color:#fff;border:none;padding:.65rem 1.75rem;border-radius:var(--radius-xs);font-weight:600;font-size:.9rem;cursor:pointer;transition:all .2s;font-family:inherit}
.btn-confirm:hover{background:var(--navy-light);transform:translateY(-1px);box-shadow:var(--shadow-sm)}

/* ═══════════ FLOATING BAR ═══════════ */
.floating-bar{position:sticky;bottom:1rem;background:var(--card);padding:1rem 1.5rem;border-radius:var(--radius);box-shadow:var(--shadow-lg);display:flex;justify-content:space-between;align-items:center;margin-top:2rem;z-index:100;border:1px solid var(--border)}
.floating-bar-info{display:flex;align-items:center;gap:.5rem;font-weight:500;font-size:.9rem;color:var(--text-muted)}
.info-dot{width:8px;height:8px;background:var(--gold);border-radius:50%;animation:dotPulse 2s infinite}
.floating-bar-actions{display:flex;gap:.6rem}
.btn-action{border:none;padding:.6rem 1.25rem;border-radius:var(--radius-xs);font-weight:600;font-size:.85rem;cursor:pointer;display:flex;align-items:center;gap:.4rem;transition:all .25s var(--ease);font-family:inherit;text-decoration:none}
.btn-action--primary{background:var(--navy);color:#fff}
.btn-action--primary:hover{background:var(--navy-light);transform:translateY(-1px)}
.btn-action--gold{background:var(--gold);color:#fff}
.btn-action--gold:hover{background:var(--gold-dark);transform:translateY(-1px)}
.btn-action--dark{background:#111;color:#fff}
.btn-action--dark:hover{background:#000;transform:translateY(-1px)}
.btn-action--ghost{background:transparent;border:1.5px solid var(--border);color:var(--text-muted)}
.btn-action--ghost:hover{border-color:var(--navy);color:var(--navy);background:rgba(15,27,45,.03)}

/* ═══════════ MODALS ═══════════ */
.modal-overlay{position:fixed;inset:0;background:rgba(15,27,45,.5);backdrop-filter:blur(4px);display:flex;align-items:center;justify-content:center;z-index:3000;padding:1rem;animation:fadeIn .25s}
.modal-panel{background:var(--card);border-radius:20px;padding:2.5rem;width:100%;max-height:90vh;overflow-y:auto;position:relative}
.modal-panel--lg{max-width:640px}
.modal-panel--xl{max-width:900px}
.modal-close{position:absolute;top:1rem;right:1.25rem;background:transparent;border:none;font-size:1.75rem;cursor:pointer;color:var(--text-faint);width:36px;height:36px;border-radius:50%;display:flex;align-items:center;justify-content:center;transition:all .2s}
.modal-close:hover{background:rgba(0,0,0,.05);color:var(--text)}
.modal-title{font-family:'Playfair Display',serif;font-size:1.75rem;font-weight:700;color:var(--navy);margin-bottom:.5rem}
.modal-desc{color:var(--text-muted);font-size:.9rem;margin-bottom:1.5rem}

/* Catalog */
.catalog-search-bar{display:flex;gap:.75rem;margin-bottom:1.5rem}
.catalog-search-bar input{flex:1;padding:.65rem 1rem;border:1.5px solid var(--border);border-radius:var(--radius-xs);font-family:inherit;font-size:.9rem;transition:border-color .2s}
.catalog-search-bar input:focus{outline:none;border-color:var(--gold)}
.catalog-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:1rem;max-height:400px;overflow-y:auto;padding:.25rem}
.catalog-card{border:1.5px solid var(--border);border-radius:var(--radius-sm);overflow:hidden;cursor:pointer;transition:all .25s var(--ease)}
.catalog-card:hover{border-color:var(--gold);transform:translateY(-3px);box-shadow:var(--shadow-md)}
.catalog-card img{width:100%;height:120px;object-fit:cover;display:block}
.catalog-card-info{padding:.75rem}
.catalog-card-info h4{font-size:.85rem;font-weight:600;color:var(--navy);margin-bottom:.2rem}
.catalog-card-info span{font-size:.7rem;color:var(--text-faint)}
.catalog-card-info .cat-price{font-weight:700;color:var(--navy);display:block;margin-top:.3rem;font-size:.8rem}

/* ═══════════ TOAST / WARNINGS ═══════════ */
.toast-warning{display:flex;align-items:center;gap:.5rem;background:rgba(252,211,77,.1);border:1px solid rgba(252,211,77,.3);color:#92400e;padding:.6rem 1rem;border-radius:var(--radius-xs);font-size:.8rem;margin-bottom:1rem}
.status-error{background:#fef2f2;border:1px solid #fecaca;color:#991b1b;padding:1rem;border-radius:var(--radius-xs);margin-bottom:1rem;font-size:.9rem}

/* ═══════════ VISUALIZATION LAYOUT (Window 4) ═══════════ */
.visualization-layout {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
}
.visualization-left {
  flex: 1;
  min-width: 0;
}
.visualization-right {
  width: 360px;
  flex-shrink: 0;
}

/* New Topbar Buttons */
.btn-outline {
  background: transparent;
  border: 1px solid #D1D5DB;
  color: #4B5563;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
}
.btn-outline:hover { background: #F9FAFB; color: #111827; }

.btn-dark-grey {
  background: #8D8D8D;
  color: #fff;
  border: none;
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-dark-grey:hover { background: #6B7280; }

/* Sidebar Card */
.sidebar-card {
  background: white;
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  display: flex;
  flex-direction: column;
}
.sidebar-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #E5E7EB;
}
.sidebar-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  color: #1A1A1A;
  font-family: 'Inter', sans-serif;
}
.sidebar-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.sidebar-tile-card {
  border: 1px solid #E5E7EB;
  border-radius: 2px;
  padding: 0.75rem;
}
.sidebar-tile-label {
  font-size: 0.65rem;
  color: #9CA3AF;
  text-transform: capitalize;
  margin-bottom: 0.5rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
}
.sidebar-tile-content {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.sidebar-tile-color {
  width: 52px;
  height: 52px;
  border-radius: 2px;
  flex-shrink: 0;
}
.sidebar-tile-info { flex: 1; }
.sidebar-tile-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1A1A1A;
  margin-bottom: 0.15rem;
  font-family: 'Inter', sans-serif;
}
.sidebar-tile-desc {
  font-size: 0.75rem;
  color: #6B7280;
  margin-bottom: 0.4rem;
}
.sidebar-tile-badge {
  display: inline-block;
  background: #1D4ED8;
  color: white;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 2px;
}
.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #E5E7EB;
}
.btn-finish-design {
  width: 100%;
  background: #8D8D8D;
  color: white;
  border: none;
  padding: 0.9rem;
  font-size: 0.9rem;
  font-weight: 500;
  font-family: inherit;
  border-radius: 2px;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-finish-design:hover { background: #6B7280; }

/* ═══════════ UTILITIES ═══════════ */
@keyframes fadeIn{from{opacity:0}to{opacity:1}}
.hidden{display:none !important}

/* ═══════════ RESPONSIVE ═══════════ */
@media(max-width:768px){
  .app-shell{padding:.5rem}
  .main-content{padding:1.5rem}
  .nav-bar{padding:.75rem 1rem}
  .nav-tagline{display:none}
  .section-title{font-size:1.5rem}

  /* Negative margins alignment on mobile */
  .hero-section {
    padding: 2rem 1.25rem;
    flex-direction: column;
    gap: 1rem;
    margin: -1.5rem -1.5rem 2rem -1.5rem;
  }
  .hero-content { max-width: 100%; }

  .results-topbar {
    padding: 0.75rem 1rem;
    margin: -1.5rem -1.5rem 1rem -1.5rem;
  }
  .topbar-selections { gap: 0.75rem; }
  .topbar-actions {
    gap: 0.4rem;
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .btn-visualize-top {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    margin-left: 0;
  }

  /* Step item layout on mobile */
  .steps-container {
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
  }
  .step-item {
    width: 100%;
    max-width: 340px;
  }

  /* Upload zone padding */
  .upload-zone {
    padding: 2.5rem 1.25rem;
  }

  /* Popup modal on mobile */
  .suggestion-popup {
    position: fixed;
    width: 100%;
    max-height: 80vh;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 16px 16px 0 0;
    animation: slideUpMobile 0.35s var(--ease);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.15);
    padding: 1rem;
    z-index: 2000;
  }
  @keyframes slideUpMobile {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .popup-body {
    max-height: 45vh;
  }
  .match-row-thumb {
    max-width: 80px;
    max-height: 80px;
  }
  .catalog-search-bar {
    flex-direction: column;
    gap: 0.5rem;
  }
  .catalog-search-bar button {
    width: 100%;
  }

  /* Catalog modal overrides */
  .modal-panel {
    padding: 1.5rem;
    border-radius: 12px;
  }
  .modal-title {
    font-size: 1.4rem;
  }
  .catalog-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    max-height: 300px;
  }

  /* Touch Slider and Labels */
  .slider-button {
    width: 44px;
    height: 44px;
  }
  .comparison-label {
    font-size: 0.7rem;
    padding: 0.3rem 0.75rem;
    bottom: 1rem;
  }
  .comparison-label.before { left: 1rem; }
  .comparison-label.after { right: 1rem; }

  .floating-bar{flex-direction:column;gap:.75rem;text-align:center}
  .visualization-layout{flex-direction:column}
  .visualization-right{width:100%}
}

