.page-header {
    background: white; padding: 2rem;
    border-bottom: 1px solid rgba(160,82,45,0.1);
  }
  .page-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem; color: var(--soil-dark);
  }
  .page-header p { color: var(--text-light); font-size: 0.9rem; margin-top: 4px; }

  .analysis-layout {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 2rem; padding: 2rem; max-width: 1100px; margin: 0 auto;
  }
  @media (max-width: 768px) { .analysis-layout { grid-template-columns: 1fr; } }

  .upload-zone {
    background: white; border-radius: var(--radius);
    border: 2px dashed rgba(160,82,45,0.3);
    padding: 3rem 2rem; text-align: center;
    cursor: pointer; transition: all 0.3s;
    position: relative; min-height: 320px;
    display: flex; align-items: center; justify-content: center;
    flex-direction: column;
  }
  .upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--soil-warm);
    background: var(--soil-pale);
  }
  .upload-icon { font-size: 3rem; margin-bottom: 1rem; }
  .upload-zone h3 { color: var(--soil-dark); font-size: 1.05rem; margin-bottom: 0.5rem; }
  .upload-zone p { color: var(--text-light); font-size: 0.85rem; }
  #file-input { display: none; }
  .upload-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; justify-content: center; }
  .btn-upload {
    padding: 10px 24px; border-radius: 50px;
    font-family: 'DM Sans', sans-serif; font-size: 0.9rem; font-weight: 500;
    cursor: pointer; transition: all 0.2s;
  }
  .btn-upload-fill {
    background: var(--soil-mid); color: white; border: none;
  }
  .btn-upload-fill:hover { background: var(--soil-dark); }
  .btn-upload-outline {
    background: transparent; color: var(--soil-mid);
    border: 1.5px solid var(--soil-mid);
  }
  .btn-upload-outline:hover { background: var(--soil-pale); }

  .preview-img {
    width: 100%; max-height: 280px; object-fit: cover;
    border-radius: var(--radius-sm); margin-bottom: 1rem;
  }
  .img-actions { display: flex; gap: 8px; justify-content: center; }
  .btn-sm {
    padding: 8px 16px; border-radius: 50px; font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif; cursor: pointer; transition: all 0.2s;
  }
  .btn-analyze {
    background: var(--green-mid); color: white; border: none;
    font-weight: 600; padding: 10px 28px;
  }
  .btn-analyze:hover { background: var(--green-deep); }
  .btn-clear { background: transparent; color: var(--text-light); border: 1px solid rgba(0,0,0,0.15); }

  .result-panel {
    background: white; border-radius: var(--radius);
    padding: 2rem; box-shadow: var(--shadow);
  }
  .result-panel h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem; color: var(--soil-dark); margin-bottom: 1.5rem;
    padding-bottom: 1rem; border-bottom: 1px solid rgba(160,82,45,0.1);
  }

  .placeholder-state {
    text-align: center; padding: 3rem 1rem;
  }
  .placeholder-state .ph-icon { font-size: 3rem; opacity: 0.3; margin-bottom: 1rem; }
  .placeholder-state p { color: var(--text-light); font-size: 0.9rem; }

  .result-content { display: none; }
  .result-content.show { display: block; }

  .loading-state { display: none; text-align: center; padding: 2rem; }
  .loading-state.show { display: block; }
  .spinner {
    width: 44px; height: 44px;
    border: 3px solid rgba(160,82,45,0.2);
    border-top-color: var(--soil-warm);
    border-radius: 50%; animation: spin 0.9s linear infinite;
    margin: 0 auto 1rem;
  }
  @keyframes spin { to { transform: rotate(360deg); } }

  /* ── NEW SOIL TYPE RESULT STYLES ── */
  .soil-type-badge {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 20px; border-radius: 50px;
    font-weight: 600; font-size: 1rem; margin-bottom: 1.2rem;
    background: var(--soil-pale); color: var(--soil-dark);
    border: 1.5px solid rgba(160,82,45,0.2);
  }

  .result-metric {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,0.06);
  }
  .result-metric:last-of-type { border-bottom: none; }
  .metric-label { font-size: 0.85rem; color: var(--text-light); }
  .metric-value { font-size: 1rem; font-weight: 600; color: var(--soil-dark); }

  .confidence-bar {
    height: 8px; background: #F0EBE3; border-radius: 50px;
    margin-top: 8px; overflow: hidden;
  }
  .confidence-fill {
    height: 100%; border-radius: 50px;
    background: linear-gradient(90deg, var(--green-light), var(--green-mid));
    transition: width 1s ease;
  }

  .soil-info-box {
    margin-top: 1.2rem; padding: 1.2rem;
    border-radius: var(--radius-sm);
    background: var(--soil-pale);
    border-left: 4px solid var(--soil-warm);
  }
  .soil-info-box h4 {
    font-size: 0.9rem; color: var(--soil-dark);
    margin-bottom: 0.5rem; font-weight: 600;
  }
  .soil-info-box p {
    font-size: 0.83rem; color: var(--text-mid);
    line-height: 1.6; margin-bottom: 0.8rem;
  }

  .crops-list {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
  }
  .crop-tag {
    background: #E8F5E9; color: #2E7D32;
    padding: 4px 10px; border-radius: 50px;
    font-size: 0.75rem; font-weight: 500;
  }

  .moisture-info {
    display: flex; align-items: center; gap: 8px;
    background: #E3F2FD; padding: 10px 14px;
    border-radius: var(--radius-sm); margin-top: 8px;
  }
  .moisture-info span { font-size: 0.85rem; color: #1565C0; font-weight: 500; }

  .top3-section { margin-top: 1.2rem; }
  .top3-section h4 {
    font-size: 0.85rem; color: var(--text-light);
    margin-bottom: 0.8rem; font-weight: 500;
  }
  .top3-item {
    display: flex; justify-content: space-between;
    align-items: center; padding: 6px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-size: 0.83rem;
  }
  .top3-item:last-child { border-bottom: none; }
  .top3-name { color: var(--soil-dark); font-weight: 500; }
  .top3-conf { color: var(--text-light); }
  .top3-bar-wrap {
    width: 80px; height: 5px;
    background: #F0EBE3; border-radius: 50px; overflow: hidden;
  }
  .top3-bar {
    height: 100%; border-radius: 50px;
    background: var(--soil-warm);
  }
  .moisture-range-section {
  margin-top: 1.2rem;
}
.moisture-range-section h4 {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: 0.8rem;
  font-weight: 500;
}
.range-track {
  position: relative;
  height: 12px;
  background: #F0EBE3;
  border-radius: 50px;
  margin: 0.5rem 0;
}
.range-fill {
  position: absolute;
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, #81C784, #2E7D32);
  transition: all 1s ease;
}
.range-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-light);
  margin-top: 4px;
}