/* LandForms - Global Styles */

h1, h2, h3, h4, h5, h6 {
  font-family: 'DM Serif Display', serif;
}

body {
  font-family: 'Inter', sans-serif;
}

/* Smooth scrolling */
html { scroll-behavior: smooth; }

/* Scroll reveal for homepage sections */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal-on-scroll.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #FAF6F0; }
::-webkit-scrollbar-thumb { background: #c4d4c0; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a898; }

/* Map styles */
#map-container { position: relative; }
#map-container .gm-style { border-radius: 12px; }

/* Search dropdown */
.lmm-search-container { position: relative; }
.lmm-search-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #E5E0D8;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 100;
  max-height: 320px;
  overflow-y: auto;
}
.lmm-search-dropdown.active { display: block; }

.lmm-search-result {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.lmm-search-result:hover,
.lmm-search-result.selected { background: #f0f7f0; }

.lmm-result-icon {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.lmm-result-icon.state { background: #e8f0e7; color: #2C3A28; }
.lmm-result-icon.county { background: #fef3c7; color: #d97706; }
.lmm-result-icon.township { background: #d1fae5; color: #059669; }
.lmm-result-icon.section { background: #ede9fe; color: #7c3aed; }

.lmm-result-name { font-weight: 500; font-size: 14px; color: #1F2937; }
.lmm-result-meta { font-size: 12px; color: #9ca3af; }

/* Boundary tooltip */
#boundaryTooltip {
  display: none;
  position: absolute;
  background: rgba(30,30,30,0.9);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 12px;
  pointer-events: none;
  z-index: 200;
  white-space: nowrap;
}

/* CDL zoom warning */
.cdl-zoom-warning {
  display: none;
  position: absolute;
  bottom: 60px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.75);
  color: white;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12px;
  z-index: 100;
  white-space: nowrap;
}

/* Map layer controls */
.map-layer-btn {
  background: white;
  border: 1px solid #E5E0D8;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  color: #1F2937;
}
.map-layer-btn:hover { background: #f0f7f0; border-color: #4A6741; }
.map-layer-btn .indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #9ca3af;
  transition: background 0.15s;
}
.map-layer-btn .indicator.active { background: #10b981; }

/* Form builder */
.field-palette-item {
  padding: 10px 14px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  cursor: grab;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  transition: all 0.15s;
}
.field-palette-item:hover {
  border-color: #4A6741;
  background: #f0f7f0;
}
.field-palette-item:active { cursor: grabbing; }

.field-palette-group { margin-bottom: 4px; }
.field-palette-group-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin: 0 0 8px 2px;
}
.field-palette-item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  width: 100%;
  text-align: left;
  font-family: inherit;
  margin-bottom: 10px;
}
.field-palette-item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
}
.field-palette-item-desc {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  line-height: 1.35;
  padding-left: 28px;
}
.field-palette-item:focus-visible {
  outline: 2px solid #4A6741;
  outline-offset: 1px;
}

.template-chip {
  font-size: 11px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #475569;
  cursor: pointer;
  transition: all 0.18s ease;
}
.template-chip:hover {
  border-color: #4A6741;
  color: #2C3A28;
  background: #f0f7f0;
  transform: translateY(-1px);
}
.template-chip:focus-visible {
  outline: 2px solid #4A6741;
  outline-offset: 2px;
}

/* ─── FIELD CARDS (sortable) ────────────────────────────── */

.field-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  cursor: default;
  touch-action: auto;
  transition: all 0.2s cubic-bezier(0.2, 0, 0, 1);
  position: relative;
  user-select: none;
}
.field-card-top {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.field-card-preview {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}
.field-card-preview-inner { pointer-events: none; }
.preview-fake-label { display: block; font-size: 11px; font-weight: 600; color: #64748b; margin-bottom: 4px; }
.preview-fake-input,
.preview-fake-textarea,
.preview-fake-select {
  width: 100%;
  font-size: 12px;
  padding: 6px 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  color: #94a3b8;
}
.preview-fake-section {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  padding: 4px 0 2px;
  border-bottom: 2px solid #e2e8f0;
}
.preview-fake-signature {
  border: 2px dashed #cbd5e1;
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
}
.preview-fake-file {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}
.preview-fake-file i { color: #4A6741; font-size: 16px; }
.preview-fake-stars { display: flex; gap: 4px; font-size: 15px; }
.preview-fake-radio-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #64748b; }

.field-badge {
  font-size: 9px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.field-badge-req { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.field-badge-cond { background: #e0e7ff; color: #4338ca; border: 1px solid #c7d2fe; }

.prop-section {
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.prop-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.prop-section-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  margin-bottom: 10px;
}
.prop-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}
.prop-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  transition: border-color 0.15s, background 0.15s;
}
.prop-input:focus {
  outline: none;
  border-color: #4A6741;
  background: #fff;
}

#builder-save-status[data-state="dirty"] {
  color: #d97706;
}
.field-card:hover {
  border-color: #c4d4c0;
  box-shadow: 0 2px 12px rgba(44, 58, 40, 0.08);
}
.field-card.selected {
  border-color: #4A6741;
  background: #f8faff;
  box-shadow: 0 0 0 2px rgba(74, 103, 65, 0.12), 0 4px 12px rgba(74, 103, 65, 0.06);
}

/* Drag handle */
.drag-handle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  min-height: 32px;
  color: #cbd5e1;
  cursor: grab;
  border-radius: 8px;
  transition: all 0.15s;
  flex-shrink: 0;
  border: none;
  background: transparent;
  padding: 0;
  touch-action: none;
}
.drag-handle:hover {
  color: #4A6741;
  background: #f0f7f0;
}
.drag-handle:active { cursor: grabbing; }

/* Icon badge */
.field-icon-badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #f0f7f0;
  color: #4A6741;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  transition: all 0.15s;
}
.field-card.selected .field-icon-badge {
  background: #4A6741;
  color: white;
}

/* Action buttons */
.field-actions {
  opacity: 0;
  transition: opacity 0.15s;
}
.field-card:hover .field-actions { opacity: 1; }
.field-card.selected .field-actions { opacity: 1; }

.field-action-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  color: #9ca3af;
  transition: all 0.15s;
  cursor: pointer;
  border: none;
  background: transparent;
}
.field-action-delete:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Ghost card (floating during drag) */
.drag-hidden {
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  overflow: hidden !important;
  padding: 0 !important;
  margin: 0 !important;
  border: none !important;
}

.field-card-ghost {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.18), 0 0 0 1.5px rgba(74, 103, 65, 0.3);
  border-color: #4A6741 !important;
  background: white;
  border-radius: 12px;
  scale: 1.02;
  opacity: 0.95;
  cursor: grabbing;
  transition: box-shadow 0.2s, scale 0.2s, opacity 0.2s;
}

.field-card-sortable-chosen {
  border-color: #4A6741;
  box-shadow: 0 8px 24px rgba(44, 58, 40, 0.12);
}

.field-card-sortable-ghost {
  opacity: 0.35;
  background: #f0f7f0;
  border: 2px dashed rgba(74, 103, 65, 0.45);
}

.field-card-sortable-fallback,
.field-palette-sortable-fallback {
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.22), 0 0 0 1px rgba(74, 103, 65, 0.28);
  transform: rotate(0.5deg);
  opacity: 0.96;
  cursor: grabbing;
}

.field-palette-sortable-chosen {
  border-color: #4A6741;
  background: #f0f7f0;
}

.field-palette-sortable-drag {
  width: 220px;
}

/* Drop placeholder */
.drag-placeholder {
  border: 2px dashed rgba(74, 103, 65, 0.35);
  border-radius: 12px;
  background: rgba(74, 103, 65, 0.03);
  transition: height 0.2s cubic-bezier(0.2, 0, 0, 1);
  animation: placeholderPulse 2s ease infinite;
}
@keyframes placeholderPulse {
  0%, 100% { border-color: rgba(74, 103, 65, 0.3); }
  50% { border-color: rgba(74, 103, 65, 0.6); }
}

/* Field enter/exit animations */
.field-card-enter {
  animation: fieldEnter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fieldEnter {
  0% { opacity: 0; transform: translateY(-8px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.field-card-exit {
  animation: fieldExit 0.25s ease forwards;
  pointer-events: none;
}
@keyframes fieldExit {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.9) translateX(20px); max-height: 0; padding: 0; margin: 0; overflow: hidden; }
}

/* Properties panel entrance */
.prop-panel-content {
  animation: propSlideIn 0.2s ease;
}
@keyframes propSlideIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Enrichment data card */
.enrichment-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.enrichment-card-header {
  background: linear-gradient(135deg, #4A6741, #4A6741);
  color: white;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.enrichment-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}
.enrichment-badge.pending { background: #fef3c7; color: #92400e; }
.enrichment-badge.success { background: #d1fae5; color: #065f46; }
.enrichment-badge.error { background: #fee2e2; color: #991b1b; }

.enrichment-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.enrichment-row:last-child { border-bottom: none; }
.enrichment-label { color: #6b7280; font-weight: 500; }
.enrichment-value { color: #1F2937; text-align: right; max-width: 60%; }

/* Loading spinner */
.loading-spinner { animation: spin-reverse 0.7s linear infinite; }
@keyframes spin-reverse { to { transform: rotate(360deg); } }

/* ─── EMAIL CHIPS ───────────────────────────────────────── */

.email-chips-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 6px 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.email-chips-container:focus-within {
  border-color: #4A6741;
  box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.1);
}

.email-chips-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.email-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 4px 3px 10px;
  background: #4A6741;
  color: white;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  animation: chipIn 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  transition: background 0.15s, transform 0.15s;
}
.email-chip:hover { background: #2C3A28; }

.email-chip-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  transition: background 0.15s, transform 0.15s;
}
.email-chip-remove:hover {
  background: rgba(255,255,255,0.35);
  transform: scale(1.15);
}

.email-chip-input {
  flex: 1;
  min-width: 180px;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  padding: 4px 2px;
  color: #1F2937;
}
.email-chip-input::placeholder { color: #9ca3af; }

@keyframes chipIn {
  0% { opacity: 0; transform: scale(0.6); }
  100% { opacity: 1; transform: scale(1); }
}

.shake {
  animation: shake 0.35s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.pulse-highlight {
  animation: pulseHighlight 0.5s ease;
}
@keyframes pulseHighlight {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); box-shadow: 0 0 0 4px rgba(74, 103, 65, 0.25); }
}

/* ─── TOGGLE SWITCH ─────────────────────────────────────── */

.toggle-switch {
  position: relative;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #d1d5db;
  border-radius: 22px;
  transition: background 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: #4A6741; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input:focus-visible + .toggle-slider { box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.2); }

/* ─── MODAL ANIMATIONS ──────────────────────────────────── */

.modal-backdrop {
  animation: fadeIn 0.2s ease;
}
.modal-content {
  animation: slideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── MICRO-INTERACTIONS ────────────────────────────────── */

/* Buttons get a subtle press effect */
button:not(:disabled):active,
a[class*="bg-primary"]:active,
a[class*="bg-accent"]:active {
  transform: scale(0.97);
}

/* Card hover lift */
.field-card .drag-handle:active { cursor: grabbing; }

/* Smooth focus transitions for all inputs */
input, textarea, select {
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}
input:focus, textarea:focus, select:focus {
  box-shadow: 0 0 0 3px rgba(74, 103, 65, 0.1);
}

/* Enrichment toggle hover */
#enrichment-toggles label {
  transition: all 0.2s;
}
#enrichment-toggles label:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* Palette item hover bounce */
.field-palette-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.field-palette-item:hover {
  transform: translateX(3px);
}

/* ─── STAGGERED CARD ENTRANCE ───────────────────────────── */

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ─── SKELETON LOADING ──────────────────────────────────── */

.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ─── SMOOTH PAGE TRANSITIONS ───────────────────────────── */

.p-6, .p-10 {
  animation: pageIn 0.3s ease;
}
@keyframes pageIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Sidebar (legacy) */
.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  position: relative;
}
.sidebar-link:hover {
  background: #f1f5f9;
  color: #334155;
}
.sidebar-link.active {
  background: #f0f7f0;
  color: #4A6741;
}
.sidebar-link.active:hover { transform: none; }

/* Signature pad */
.signature-pad {
  border: 2px dashed #e2e8f0;
  border-radius: 8px;
  background: white;
  cursor: crosshair;
}
.signature-pad:hover { border-color: #4A6741; }

/* Star rating */
.star-rating { display: flex; gap: 4px; }
.star-rating .star {
  font-size: 24px;
  cursor: pointer;
  color: #e2e8f0;
  transition: color 0.1s;
}
.star-rating .star.active { color: #f59e0b; }
.star-rating .star:hover { color: #f59e0b; }

/* Integration pills */
.integration-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  color: #374151;
  white-space: nowrap;
  transition: all 0.15s;
}
.integration-pill:hover {
  border-color: #FF4A00;
  color: #FF4A00;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(255, 74, 0, 0.08);
}
.integration-pill-more {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: #FF4A00;
  border: 1px solid #FF4A00;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  color: white;
  white-space: nowrap;
}

/* Integration logo grid (homepage) */
.integration-logo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 20px 12px;
  background: white;
  border: 1px solid #E5E0D8;
  border-radius: 16px;
  transition: all 0.2s ease;
}
.integration-logo-card:hover {
  border-color: #FF4A00;
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(255, 74, 0, 0.08);
}
.integration-logo-card img, .integration-logo-card svg {
  width: 36px;
  height: 36px;
  object-fit: contain;
}
.si-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #F8F5EF;
  border: 1px solid #ECE6DC;
  transition: all 0.2s ease;
}
.integration-logo-card:hover .si-icon-wrap {
  background: #FFFFFF;
  border-color: #FFD9C7;
  box-shadow: 0 4px 12px rgba(255, 74, 0, 0.06);
}
.si-icon-wrap img,
.si-icon-wrap svg {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.integration-logo-card span {
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  text-align: center;
}

@keyframes floatIn {
  from { opacity: 0; transform: translateY(12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.integration-animate {
  opacity: 0;
  animation: floatIn 0.4s ease forwards;
}

/* Success modal animations */
.success-check-circle {
  animation: successPop 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.15s both;
}
.success-check-icon path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: checkDraw 0.4s ease 0.4s forwards;
}
@keyframes successPop {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes checkDraw {
  to { stroke-dashoffset: 0; }
}

/* ─── ENRICHMENT RESULT TABLES ──────────────────────────── */
/* Suppress Bootstrap's blue row-hover highlight; keep cells selectable */
.enrich-result-table tbody tr:hover { background: transparent !important; }
.enrich-result-table tbody tr:hover td { background: transparent !important; color: inherit !important; }
.enrich-result-table td { user-select: text; cursor: text; }
/* Restore pointer + hover only on CSV download buttons inside the table */
.enrich-result-table td a[download] { cursor: pointer; }
.enrich-result-table td a[download]:hover { background: #f0fdf4 !important; border-color: #86efac !important; color: #166534 !important; }

/* ─── TRACT MANAGER ─────────────────────────────────────── */

.tract-card {
  background: #fff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.tract-card.active {
  border-color: #4A6741;
  box-shadow: 0 0 0 3px rgba(74, 103, 65,0.1);
}
.tract-card.ready {
  border-color: #10b981;
}
.tract-card.error {
  border-color: #ef4444;
}

.tract-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  cursor: pointer;
  background: #f8fafc;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.tract-card-header:hover { background: #f1f5f9; }

.tract-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tract-name {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  flex: 1;
  min-width: 0;
}

.tract-summary {
  font-size: 11px;
  color: #64748b;
  white-space: nowrap;
}

.tract-status-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.tract-status-badge.pending   { background: #f1f5f9; color: #64748b; }
.tract-status-badge.selecting { background: #fef3c7; color: #92400e; }
.tract-status-badge.enriching { background: #e8f0e7; color: #2C3A28; }
.tract-status-badge.ready     { background: #d1fae5; color: #065f46; }
.tract-status-badge.error     { background: #fee2e2; color: #991b1b; }

.tract-body {
  padding: 10px 12px 12px;
  border-top: 1px solid #f1f5f9;
}

.tract-method-row {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.tract-method-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 10px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px; /* mobile tap target */
}
.tract-method-btn:hover { background: #f1f5f9; border-color: #cbd5e1; }
.tract-method-btn.active {
  background: #f0f7f0;
  border-color: #4A6741;
  color: #2C3A28;
}
.tract-method-btn.active i { color: #4A6741; }

.tract-feature-count {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 8px;
  min-height: 16px;
}

.tract-actions {
  display: flex;
  gap: 6px;
}

.tract-btn-done {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  background: #10b981;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.tract-btn-done:hover:not(:disabled) { background: #059669; }
.tract-btn-done:active:not(:disabled) { transform: scale(0.97); }
.tract-btn-done:disabled { opacity: 0.5; cursor: not-allowed; }

.tract-btn-edit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 9px 12px;
  background: #f1f5f9;
  color: #475569;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.tract-btn-edit:hover { background: #e2e8f0; color: #1e293b; }

.tract-btn-delete {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  background: #fff;
  color: #94a3b8;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}
.tract-btn-delete:hover { background: #fee2e2; color: #ef4444; border-color: #fca5a5; }

.tract-btn-view {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex: 1;
  padding: 10px 14px;
  background: linear-gradient(135deg, #4A6741, #6B8C61);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 44px;
  box-shadow: 0 1px 4px rgba(74, 103, 65, 0.35);
  -webkit-tap-highlight-color: transparent;
}
.tract-btn-view:hover { background: linear-gradient(135deg, #2C3A28, #4A6741); box-shadow: 0 2px 8px rgba(44, 58, 40, 0.35); }
.tract-btn-view:active { transform: scale(0.97); }

.tract-enrichment-preview {
  margin-top: 8px;
  padding: 8px 10px;
  background: #f0fdf4;
  border-radius: 8px;
  border: 1px solid #bbf7d0;
  font-size: 11.5px;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tract-enrichment-preview i { color: #10b981; flex-shrink: 0; }

/* Acres breakdown: xx.xx + xx.xx = xxx.xx */
.tract-acres-breakdown {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  line-height: 1.4;
  word-break: break-all;
}
.tract-acres-parts { color: #64748b; }
.tract-acres-equals { color: #94a3b8; margin: 0 2px; }
.tract-acres-sum { color: #1e293b; font-weight: 700; }


/* ── Enrichment Modal Map ── */
.enrich-layer-btn {
  padding: 3px 10px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #374151;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  line-height: 1.6;
}
.enrich-layer-btn:hover { background: #f0f7f0; border-color: #c4d4c0; color: #2C3A28; }
.enrich-layer-btn.active { background: #4A6741; color: #fff; border-color: #4A6741; font-weight: 600; }

.enrich-layer-group-label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin-right: 2px;
  white-space: nowrap;
}
.enrich-legend-swatch {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  gap: 3px;
}

/* ── Soils table (shared between enrichment modal & soils-map page) ── */
.pf-soils-summary {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px;
  background: #e5e0d8; border-radius: 8px; overflow: hidden; margin-bottom: 0;
}
.pf-soils-summary .s-cell {
  background: #fff; padding: 14px 16px; text-align: center;
}
.pf-soils-summary .s-label {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.06em;
  color: #888; font-weight: 600;
}
.pf-soils-summary .s-val {
  font-size: 22px; font-weight: 700; color: #1a1a2e; margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.pf-soils-grid-wrap { padding: 0; }
.pf-soils-grid { min-width: 0; font-size: 12px; }
.pf-soils-grid-header,
.pf-soil-row,
.pf-soils-grid-footer {
  display: grid;
  grid-template-columns: 28px 56px minmax(100px,1fr) 40px 56px 52px 50px 44px;
  column-gap: 6px; align-items: center;
}
.pf-soils-grid-header {
  position: sticky; top: 0; z-index: 1; background: #fff;
  border-bottom: 2px solid #e5e0d8; padding: 7px 14px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: #999;
}
.pf-soil-row {
  border-bottom: 1px solid #f0ede8; padding: 7px 14px;
  transition: background 0.12s;
}
.pf-soil-row:hover { background: #f5f3ee; }
.pf-soils-grid-footer {
  padding: 8px 14px; border-top: 2px solid #e5e0d8;
  font-size: 12px; color: #1a1a2e;
}
.pf-soil-swatch {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.1);
}
.pf-soil-cell-sw { display: flex; justify-content: center; }
.pf-soil-cell-code { font-weight: 700; color: #1a1a2e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-soil-cell-desc { color: #555; line-height: 1.35; white-space: normal; word-break: break-word; }
.pf-soil-cell-r { text-align: right; font-weight: 600; color: #1a1a2e; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Public-form modal variant: keep cells single-line and allow horizontal scrolling */
.pf-soils-grid-wrap--scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
}
.pf-soils-grid-wrap--scroll .pf-soils-grid {
  width: max-content;
  min-width: 100%;
}
.pf-soils-grid-wrap--scroll .pf-soils-grid-header,
.pf-soils-grid-wrap--scroll .pf-soil-row,
.pf-soils-grid-wrap--scroll .pf-soils-grid-footer {
  grid-template-columns: 28px 64px 460px 52px 68px 64px 62px 56px;
}
.pf-soils-grid-wrap--scroll .pf-soils-grid-header > div,
.pf-soils-grid-wrap--scroll .pf-soil-cell-code,
.pf-soils-grid-wrap--scroll .pf-soil-cell-desc,
.pf-soils-grid-wrap--scroll .pf-soil-cell-r {
  white-space: nowrap;
}
.pf-soils-grid-wrap--scroll .pf-soil-cell-code,
.pf-soils-grid-wrap--scroll .pf-soil-cell-desc {
  overflow: visible;
  text-overflow: clip;
  word-break: normal;
}

/* Public-form modal: keep description on one line */
.pf-soils-grid-wrap--desc-nowrap .pf-soil-cell-desc {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  word-break: normal;
}
