   Aeration Designer
   ============================================ */

/* View override — prevent .view scroll from breaking height chain */
#view-aeration {
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
#view-aeration.active { display: flex; }
#view-aeration #aeration-designer-content {
  flex: 1;
  min-height: 0;
  height: 100%;
}

/* Layout — full viewport split */
.aeration-designer { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
.aeration-layout { flex: 1; display: flex; overflow: hidden; min-height: 0; height: 100%; }

/* Sidebar (left panel) — narrow in map mode, full-width in form mode */
.aeration-sidebar {
  width: 380px;
  min-width: 320px;
  max-width: 420px;
  flex-shrink: 0;
  background: var(--bg-card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.aeration-designer.form-mode .aeration-sidebar {
  width: 100%;
  max-width: none;
  min-width: 0;
  border-right: none;
  overflow-y: auto;
}
.aeration-designer.form-mode .aeration-sidebar-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px 24px;
}
.aeration-sidebar-inner {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
}

/* Map area (right) */
.aeration-map-area { flex: 1; position: relative; display: flex; flex-direction: column; min-width: 0; }
.aeration-map-container { flex: 1; position: relative; background: var(--bg); min-height: 300px; }
.aeration-map-container .esri-view { width: 100%; height: 100%; }

/* Map overlay instructions */
.aeration-map-instructions {
  position: absolute;
  top: 12px; left: 70px;
  background: var(--navy);
  color: #fff;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 10;
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  pointer-events: none;
  transition: opacity 0.3s;
  max-width: calc(100% - 200px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.aeration-map-instructions.hidden { opacity: 0; }

/* Acreage badge on map */
.aeration-acreage-badge {
  position: absolute;
  bottom: 12px; left: 12px;
  background: var(--navy);
  color: var(--cream-text);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Step bar */
.aeration-step-bar {
  display: flex;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
  scrollbar-width: none;
  gap: 2px;
  padding: 0 4px;
}
.aeration-step-bar::-webkit-scrollbar { display: none; }
.aeration-step-tab {
  flex: 0 0 auto;
  padding: 10px 10px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.2s;
  white-space: nowrap;
}
.aeration-step-tab.active {
  color: var(--cream-text);
  border-bottom-color: var(--cream-text);
  background: rgba(242,229,179,0.06);
}
.aeration-step-tab.completed {
  color: var(--success);
  border-bottom-color: var(--success);
}
.aeration-step-tab.disabled { opacity: 0.35; pointer-events: none; }
.aeration-step-num {
  display: inline-block;
  width: 18px; height: 18px;
  line-height: 18px;
  border-radius: 50%;
  background: var(--border);
  color: var(--bg);
  font-size: 10px;
  margin-right: 3px;
  vertical-align: middle;
  text-align: center;
}
.aeration-step-tab.active .aeration-step-num { background: var(--cream); color: var(--navy); }
.aeration-step-tab.completed .aeration-step-num { background: var(--success); color: #fff; }

/* Panels (step content) */
.aeration-panel { display: none; padding: 16px; }
.aeration-panel.active { display: block; }
.aeration-step { display: none; padding: 16px; }

/* Pond selector */
.aeration-pond-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.aeration-pond-selector label {
  font-size: 12px;
  font-weight: 700;
  color: var(--cream-text);
  white-space: nowrap;
}
.aeration-pond-selector select {
  flex: 1;
  min-width: 0;
}
.aeration-pond-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.aeration-no-ponds {
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}
.aeration-no-ponds .btn-primary { margin-top: 8px; }

/* Section helpers */
.aeration-section { margin-bottom: 16px; }
.aeration-section-title { font-size: 14px; font-weight: 700; color: var(--cream-text); margin-bottom: 10px; }

/* Form layout */
.aeration-form-row { display: flex; gap: 12px; margin-bottom: 12px; }
.aeration-form-group { flex: 1; }
.aeration-form-group label { display: block; font-size: 12px; font-weight: 600; color: var(--text-muted); margin-bottom: 4px; }

/* Button row */
.aeration-btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.aeration-btn-row .spacer { flex: 1; }

/* Checkbox / radio grid */
.aeration-checkbox-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 16px; }
.aeration-checkbox-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  color: var(--text);
}
.aeration-checkbox-item:hover { background: rgba(242,229,179,0.06); }
.aeration-checkbox-item.selected { background: rgba(242,229,179,0.1); border-color: var(--cream-text); }

/* Search bar in step 1 */
.aeration-search-bar { display: flex; gap: 8px; margin-bottom: 8px; }
.aeration-search-bar .form-input { flex: 1; }

/* Autocomplete suggest list */
.aeration-suggest-list {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 200px;
  overflow-y: auto;
  display: none;
}
.aeration-suggest-list.visible { display: block; }
.aeration-suggest-item {
  padding: 8px 12px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.aeration-suggest-item:hover { background: rgba(242,229,179,0.08); }
.aeration-suggest-item:last-child { border-bottom: none; }

/* Loading state */
.aeration-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
  gap: 12px;
}
.aeration-loading::before {
  content: '';
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--cream-text);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Info box */
.aeration-info-box {
  padding: 10px 14px;
  background: rgba(242,229,179,0.06);
  border: 1px solid rgba(242,229,179,0.15);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Escalation card */
.aeration-escalation-card {
  padding: 12px 16px;
  background: rgba(230,126,34,0.08);
  border: 1px solid rgba(230,126,34,0.3);
  border-radius: 8px;
  margin-bottom: 12px;
  font-size: 13px;
  color: var(--warning);
  line-height: 1.5;
}
.aeration-escalation-card strong { display: block; margin-bottom: 4px; }
.aeration-escalation-card p { color: var(--text-muted); font-size: 12px; }

/* Recommendation cards */
.aeration-rec-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 14px;
  background: var(--bg-card);
}
.aeration-rec-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.aeration-rec-category {
  font-size: 13px;
  font-weight: 700;
  color: var(--cream-text);
}
.aeration-rec-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  background: rgba(39,174,96,0.15);
  color: var(--success);
}

/* Product grid inside recommendation */
.aeration-product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin-top: 10px;
}
.aeration-product-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: border-color 0.15s;
}
.aeration-product-card:hover { border-color: var(--cream-text); }
.aeration-product-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--cream-text);
}
.aeration-product-specs {
  font-size: 12px;
  color: var(--text-muted);
}
.aeration-product-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
}
.aeration-product-detail { color: var(--text-dim); font-size: 11px; margin-top: 2px; }

/* Selected equipment banner */
.aeration-selected-banner {
  padding: 12px 14px;
  background: rgba(39,174,96,0.08);
  border: 1px solid rgba(39,174,96,0.25);
  border-radius: 8px;
  margin-bottom: 12px;
}
.aeration-selected-banner h4 { font-size: 13px; color: var(--success); margin-bottom: 6px; }

/* Placement controls */
.aeration-placement-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.aeration-place-mode.active {
  background: var(--cream) !important;
  color: var(--navy) !important;
  border-color: var(--cream-text) !important;
}

/* Diffuser counter badge */
.aeration-diffuser-counter {
  font-size: 11px;
  font-weight: 700;
  color: var(--cream-text);
  padding: 2px 8px;
  background: rgba(242,229,179,0.15);
  border-radius: 10px;
}

/* Placement hint */
.aeration-placement-hint {
  font-size: 12px;
  color: var(--cream-text);
  padding: 8px 12px;
  background: rgba(242,229,179,0.06);
  border-radius: 6px;
  border: 1px dashed var(--cream);
}

/* Velocity legend */
.aeration-velocity-legend {
  padding: 10px 14px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin: 8px 0 12px;
}
.aeration-velocity-legend h4 { font-size: 12px; color: var(--cream-text); margin-bottom: 6px; }
.aeration-velocity-legend-bar {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(to right, #0000ff, #00ccff, #ffff00, #ff0000);
  margin-bottom: 4px;
}
.aeration-velocity-legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--text-dim);
}

/* System performance panel */
.aeration-sysperf {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-surface);
  margin: 12px 0;
  overflow: hidden;
}
.aeration-sysperf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--cream-text);
}
.aeration-sysperf-body { padding: 12px 14px; }
.aeration-sysperf-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.aeration-sysperf-card {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255,255,255,0.02);
  text-align: center;
}
.aeration-sysperf-label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.aeration-sysperf-value { font-size: 20px; font-weight: 700; color: var(--cream-text); }
.aeration-sysperf-rating { font-size: 11px; font-weight: 600; margin-top: 2px; }
.aeration-sysperf-details { font-size: 12px; color: var(--text-dim); line-height: 1.6; }

/* Ghost marker banner */
.aeration-ghost-banner {
  padding: 10px 14px;
  background: rgba(0,100,200,0.08);
  border: 1px solid rgba(0,100,200,0.25);
  border-radius: 8px;
  margin: 10px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.aeration-ghost-banner span { font-size: 12px; color: var(--text-muted); flex: 1; }

/* Summary table in step 6 */
.aeration-summary-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}
.aeration-summary-table th {
  text-align: left;
  padding: 8px 10px;
  background: var(--bg-surface);
  color: var(--cream-text);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.aeration-summary-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.aeration-summary-table tr:last-child td { border-bottom: none; }

/* Placement list items */
.aeration-placement-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 12px;
  background: rgba(255,255,255,0.02);
}
.aeration-placement-item .remove-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--danger);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
}

/* ── Responsive: Mobile bottom sheet ── */
@media (max-width: 768px) {
  .aeration-layout {
    flex-direction: column-reverse;
  }
  .aeration-sidebar {
    width: 100%;
    min-width: unset;
    max-width: unset;
    max-height: 50vh;
    border-right: none;
    border-top: 1px solid var(--border);
  }
  .aeration-map-container { min-height: 250px; }
  .aeration-map-instructions {
    left: 12px;
    max-width: calc(100% - 100px);
    font-size: 11px;
    padding: 6px 12px;
  }
  .aeration-step-tab { min-width: 70px; font-size: 10px; padding: 8px 4px; }
  .aeration-step-num { width: 16px; height: 16px; line-height: 16px; font-size: 9px; }
  .aeration-product-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .aeration-sidebar { max-height: 60vh; }
  .aeration-checkbox-grid { grid-template-columns: 1fr; }
}

/* ── Light mode overrides ── */
html.light-mode .aeration-sidebar { background: #fff; border-color: #e0ddd5; }
html.light-mode .aeration-step-bar { background: #f8f7f3; border-color: #e0ddd5; }
html.light-mode .aeration-step-tab { color: #999; }
html.light-mode .aeration-step-tab.active { color: var(--navy); border-bottom-color: var(--navy); background: rgba(20,27,69,0.04); }
html.light-mode .aeration-step-tab.completed { color: var(--green); border-bottom-color: var(--green); }
html.light-mode .aeration-step-num { background: #ddd; color: #fff; }
html.light-mode .aeration-step-tab.active .aeration-step-num { background: var(--navy); color: #fff; }
html.light-mode .aeration-step-tab.completed .aeration-step-num { background: var(--green); }
html.light-mode .aeration-section-title { color: var(--navy); }
html.light-mode .aeration-rec-card { background: rgba(0,0,0,0.02); border-color: #e0ddd5; }
html.light-mode .aeration-rec-category { color: var(--navy); }
html.light-mode .aeration-product-card { background: rgba(0,0,0,0.02); border-color: #e0ddd5; }
html.light-mode .aeration-product-name { color: #333; }
html.light-mode .aeration-info-box { background: rgba(20,27,69,0.04); border-color: rgba(20,27,69,0.12); }
html.light-mode .aeration-sysperf { background: #f8f7f3; border-color: #e0ddd5; }
html.light-mode .aeration-sysperf-header { color: var(--navy); }
html.light-mode .aeration-sysperf-value { color: var(--navy); }
html.light-mode .aeration-sysperf-card { background: rgba(0,0,0,0.02); border-color: #e0ddd5; }
html.light-mode .aeration-velocity-legend { background: #f8f7f3; border-color: #e0ddd5; }
html.light-mode .aeration-checkbox-item { border-color: #e0ddd5; color: #333; }
html.light-mode .aeration-checkbox-item.selected { background: rgba(20,27,69,0.06); border-color: var(--navy); }
html.light-mode .aeration-suggest-list { background: #fff; border-color: #e0ddd5; }
html.light-mode .aeration-suggest-item { color: #333; border-color: #eee; }
html.light-mode .aeration-suggest-item:hover { background: rgba(20,27,69,0.04); }
html.light-mode .aeration-acreage-badge { background: var(--navy); color: var(--cream-text); }
html.light-mode .aeration-placement-item { background: rgba(0,0,0,0.02); border-color: #e0ddd5; }
html.light-mode .aeration-summary-table th { background: #f0ede4; color: var(--navy); }
html.light-mode .aeration-summary-table td { color: #333; }
html.light-mode .aeration-map-instructions { background: var(--navy); color: #fff; }
html.light-mode .aeration-velocity-legend h4 { color: var(--navy); }
html.light-mode .aeration-place-mode { color: #333; border-color: #d8d5cc; }
html.light-mode .aeration-place-mode.active { background: var(--navy) !important; color: #fff !important; border-color: var(--navy) !important; }
html.light-mode .aeration-pond-selector { background: #f8f7f3; border-color: #e0ddd5; }
html.light-mode .aeration-pond-selector label { color: var(--navy); }
html.light-mode .aeration-pond-label { color: #333; }
