/* ============================================
   MyPond — Natural Waterscapes
   Brand: Navy #141b45, Green #1c4220, 
          Brown #8f5a2a, Cream #F2E5b3
   Font: Tahoma, system fallback
   ============================================ */

:root {
  --navy: #141b45;
  --navy-light: #1e2a5e;
  --navy-dark: #0d1230;
  --green: #1c4220;
  --green-light: #2a6330;
  --brown: #8f5a2a;
  --cream: #F2E5b3;
  --cream-muted: #d4c899;
  --bg: #0b0f24;
  --bg-card: #141b45;
  --bg-surface: #1a2350;
  --text: #f0ede4;
  --text-muted: #e0e1f0;
  --text-dim: #c0c2d4;
  --border: #2a3060;
  --danger: #c0392b;
  --success: #27ae60;
  --warning: #e67e22;
  --tab-height: 60px;
  --header-height: 52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
button { cursor: pointer; user-select: none; }

/* Hide number input spinners */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }
/* Ensure cursor visible on focus */
input:focus, textarea:focus { caret-color: var(--text); }

html, body {
  height: 100%;
  overflow: hidden;
  font-family: Tahoma, 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Scientific log-scale grid background */
.main-content {
  background:
    /* Major gridlines — every 48px */
    repeating-linear-gradient(to right, rgba(242,229,179,0.06) 0px, transparent 1px, transparent 48px),
    repeating-linear-gradient(to bottom, rgba(242,229,179,0.06) 0px, transparent 1px, transparent 48px),
    /* Mid gridlines — every 24px */
    repeating-linear-gradient(to right, rgba(242,229,179,0.03) 0px, transparent 1px, transparent 24px),
    repeating-linear-gradient(to bottom, rgba(242,229,179,0.03) 0px, transparent 1px, transparent 24px),
    /* Log-scale minor lines — clustered near the majors (4px, 10px from each major) */
    repeating-linear-gradient(to right, rgba(242,229,179,0.018) 0px, transparent 1px, transparent 4px, rgba(242,229,179,0.012) 4px, transparent 5px, transparent 10px, rgba(242,229,179,0.008) 10px, transparent 11px, transparent 48px),
    repeating-linear-gradient(to bottom, rgba(242,229,179,0.018) 0px, transparent 1px, transparent 4px, rgba(242,229,179,0.012) 4px, transparent 5px, transparent 10px, rgba(242,229,179,0.008) 10px, transparent 11px, transparent 48px),
    var(--bg);
}

/* Loading screen */
.loading-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
}
.loading-content { text-align: center; }
.loading-logo { font-size: 28px; font-weight: 700; color: var(--cream); letter-spacing: 1px; }
.loading-sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.loading-spinner {
  width: 32px; height: 32px; margin: 20px auto 0;
  border: 3px solid var(--border); border-top-color: var(--cream);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Login screen */
.login-screen {
  position: fixed; inset: 0; z-index: 9998;
  display: flex; align-items: center; justify-content: center;
  background:
    repeating-linear-gradient(to right, rgba(242,229,179,0.06) 0px, transparent 1px, transparent 48px),
    repeating-linear-gradient(to bottom, rgba(242,229,179,0.06) 0px, transparent 1px, transparent 48px),
    repeating-linear-gradient(to right, rgba(242,229,179,0.03) 0px, transparent 1px, transparent 24px),
    repeating-linear-gradient(to bottom, rgba(242,229,179,0.03) 0px, transparent 1px, transparent 24px),
    repeating-linear-gradient(to right, rgba(242,229,179,0.018) 0px, transparent 1px, transparent 4px, rgba(242,229,179,0.012) 4px, transparent 5px, transparent 10px, rgba(242,229,179,0.008) 10px, transparent 11px, transparent 48px),
    repeating-linear-gradient(to bottom, rgba(242,229,179,0.018) 0px, transparent 1px, transparent 4px, rgba(242,229,179,0.012) 4px, transparent 5px, transparent 10px, rgba(242,229,179,0.008) 10px, transparent 11px, transparent 48px),
    var(--bg);
  padding: 1rem;
}
.login-container {
  width: 100%; max-width: 440px; text-align: center;
}
.login-header { margin-bottom: 2rem; }
.login-logo {
  font-size: 2.2rem; font-weight: 700; color: var(--cream); letter-spacing: 1px;
}
.login-sub {
  font-size: 0.85rem; color: var(--text-muted); margin-top: 0.25rem;
}
.login-tagline {
  font-size: 0.95rem; color: var(--text-dim); margin-top: 1rem; line-height: 1.5;
}
.clerk-auth-container {
  min-height: 300px;
  display: flex; align-items: center; justify-content: center;
}

/* App layout */
.app {
  display: flex; flex-direction: column;
  height: 100%; overflow: hidden;
  position: relative;
  max-width: 1920px; margin: 0 auto;
}
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  height: var(--header-height); padding: 0 12px;
  background: var(--cream); border-bottom: 1px solid var(--cream-muted);
  flex-shrink: 0; z-index: 100;
  padding-top: var(--safe-top);
}
.header-left { display: flex; align-items: center; gap: 8px; }
.header-right { display: flex; align-items: center; gap: 6px; }
.header-title { font-size: 18px; font-weight: 700; color: var(--navy); letter-spacing: 0.5px; }
.header-brand {
  font-size: 14px; font-weight: 700; color: var(--navy); letter-spacing: 0.3px;
  white-space: nowrap; line-height: 1;
}
.header-brand .tm { font-size: 7px; vertical-align: super; font-weight: 400; }
.header-brand .brand-by { font-weight: 400; font-size: 11px; color: var(--navy-light); margin-left: 1px; }
.header-nw-logo {
  height: 26px; width: auto; object-fit: contain;
}
.header-btn {
  background: none; border: none; color: var(--navy); cursor: pointer;
  padding: 6px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
}
.header-btn:hover { color: var(--navy-light); background: rgba(20,27,69,0.08); }
.back-btn {
  display: flex; align-items: center; gap: 4px; background: none; border: none;
  color: var(--navy); cursor: pointer; padding: 5px 12px 5px 8px; border-radius: 8px;
  font-size: 14px; font-weight: 600; font-family: inherit;
}
.back-btn:hover { background: rgba(20,27,69,0.08); }
.back-btn svg { flex-shrink: 0; }

/* Main content */
.main-content {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  position: relative;
}
.view { display: none; height: 100%; overflow-y: auto; position: relative; }
.view.active { display: block; }
.hidden { display: none !important; }

/* Bottom tab bar */
.tab-bar {
  display: flex; align-items: stretch; justify-content: space-around;
  height: var(--tab-height); flex-shrink: 0;
  background: var(--navy-dark); border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  z-index: 100;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px;
  background: none; border: none; color: #fff; cursor: pointer;
  font-size: 12px; font-family: inherit; padding: 4px 0;
  transition: color 0.15s;
}
.tab-item svg { transition: color 0.15s; stroke: #fff; }
.tab-item.active { color: var(--cream); }
.tab-item.active svg { stroke: var(--cream); }
.tab-item:not(.active):hover { color: var(--cream); }

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border: none; border-radius: 10px;
  background: var(--cream); color: var(--navy-dark);
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.btn-primary:hover { background: #e8dba0; }
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 16px; border: 1.5px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.btn-secondary:hover { background: rgba(255,255,255,0.06); }
.btn-large { padding: 14px 32px; font-size: 16px; width: 100%; max-width: 340px; }
.btn-small { padding: 6px 12px; font-size: 12px; }

/* Welcome view */
.welcome-container {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 24px 32px; text-align: center; max-width: 440px; margin: 0 auto;
}
.welcome-hero { margin-bottom: 32px; }
.welcome-icon { margin-bottom: 16px; opacity: 0.9; }
.welcome-title { font-size: 24px; font-weight: 700; color: var(--cream); margin-bottom: 8px; }
.welcome-tagline { font-size: 15px; color: var(--text-muted); line-height: 1.5; }
.welcome-features { width: 100%; margin-bottom: 32px; }
.feature-item {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 12px 0; text-align: left;
}
.feature-icon { font-size: 22px; flex-shrink: 0; width: 32px; text-align: center; }
.feature-text { display: flex; flex-direction: column; gap: 2px; }
.feature-text strong { font-size: 14px; color: var(--text); }
.feature-text span { font-size: 13px; color: var(--text-muted); }
.welcome-note { font-size: 12px; color: var(--text-dim); margin-top: 12px; }

/* Map */
.map-container { width: 100%; height: 100%; }
.wizard-map-container .map-container { width: 100%; height: 100%; }
.map-pond-selector {
  position: absolute; top: 56px; right: 12px; z-index: 10;
}
.map-fab {
  position: absolute; top: 12px; right: 12px; z-index: 10;
  height: 36px; padding: 0 14px; border-radius: 18px;
  background: var(--cream); color: var(--navy-dark); border: none;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  transition: transform 0.15s, background 0.15s;
  font-family: inherit; font-size: 13px; font-weight: 700;
  white-space: nowrap;
}
.map-fab:hover { background: #e8dba0; transform: scale(1.03); }
.map-fab:active { transform: scale(0.97); }
/* When back bar is visible, push FAB below it */
.map-back-bar:not(.hidden) ~ .map-fab { top: 56px; }

/* Floating pond action panel — shown on pond click */
.map-pond-panel {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  z-index: 20; width: calc(100% - 32px); max-width: 400px;
  background: var(--navy); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.6);
}
.map-pond-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.map-pond-panel-header h3 {
  font-size: 16px; font-weight: 700; color: var(--cream);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.map-pond-panel-close {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  padding: 4px; border-radius: 6px; flex-shrink: 0;
}
.map-pond-panel-close:hover { color: var(--text); background: rgba(255,255,255,0.08); }
.map-pond-panel-stats {
  display: flex; gap: 16px; margin-bottom: 12px;
  font-size: 13px; color: var(--text-muted);
}
.map-pond-panel-stat { display: flex; flex-direction: column; gap: 1px; }
.map-pond-panel-stat-value { font-size: 15px; font-weight: 700; color: var(--cream); }
.map-pond-panel-stat-label { font-size: 11px; color: var(--text-dim); }
.map-pond-panel-actions {
  display: flex; gap: 8px;
}
.map-pond-panel-actions .btn-primary,
.map-pond-panel-actions .btn-secondary { flex: 1; text-align: center; }

/* Floating back bar — appears on map when navigating from pond detail */
.map-back-bar {
  position: absolute; top: 12px; right: 12px; z-index: 15;
}
.map-back-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px 8px 12px; border-radius: 22px;
  background: var(--navy); color: var(--cream); border: 1px solid var(--cream-muted);
  cursor: pointer; box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  font-family: inherit; font-size: 13px; font-weight: 700;
  white-space: nowrap; transition: background 0.15s, transform 0.15s;
}
.map-back-btn:hover { background: var(--navy-light); transform: scale(1.03); }
.map-back-btn:active { transform: scale(0.97); }
.map-back-btn svg { flex-shrink: 0; }

/* View headers */
.view-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 12px; border-bottom: 1px solid var(--border);
}
.view-header h2 { font-size: 20px; font-weight: 700; color: var(--cream); }

/* Pond list */
.ponds-list { padding: 8px 12px; }
.pond-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px; margin-bottom: 8px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  cursor: pointer; transition: background 0.15s;
}
.pond-card:hover { background: var(--bg-surface); }
.pond-card-thumb {
  width: 56px; height: 56px; border-radius: 8px;
  background: var(--bg-surface); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim); font-size: 20px;
}
.pond-card-info { flex: 1; min-width: 0; }
.pond-card-name { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pond-card-meta { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.pond-card-arrow { color: var(--text-dim); flex-shrink: 0; }

/* Profile */
.profile-content { padding: 16px; max-width: 480px; margin: 0 auto; }
.profile-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 16px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  margin-bottom: 20px;
}
.profile-avatar {
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--cream); color: var(--navy-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-email { font-size: 15px; font-weight: 600; }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  background: var(--green); color: var(--cream); margin-top: 4px;
}
.profile-stats {
  display: flex; gap: 12px; margin-bottom: 20px;
}
.stat-item {
  flex: 1; text-align: center; padding: 4px 6px;
  border-right: 1px solid var(--border);
}
.stat-item:last-child { border-right: none; }
.stat-value { display: block; font-size: 18px; font-weight: 700; color: var(--cream); line-height: 1.2; }
.stat-label { display: block; font-size: 14px; color: var(--text-muted); margin-top: 0; }
.stat-sub { display: block; font-size: 13px; color: var(--text-dim); margin-top: 0; }

.profile-section { margin-bottom: 20px; }
.profile-section h3 { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.profile-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.profile-row span:first-child { color: var(--text-muted); }
.profile-link {
  display: block; padding: 10px 0; border-bottom: 1px solid var(--border);
  color: var(--cream); font-size: 14px; text-decoration: none;
}
.profile-link:hover { color: #fff; }

/* Selects */
.pond-select {
  padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-card); color: var(--text); font-family: inherit; font-size: 13px;
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 6 5-6' fill='%239a9bb0'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}

/* Water Quality */
.wq-content { padding: 12px 16px; }
.wq-pond-filter { padding: 12px 16px 0; }
.wq-reading-card {
  padding: 14px; margin-bottom: 8px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.wq-reading-date { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.wq-reading-params { display: flex; flex-wrap: wrap; gap: 8px; }
.wq-param {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 10px; border-radius: 6px;
  background: var(--bg-surface); font-size: 12px;
}
.wq-param-label { color: var(--text-muted); }
.wq-param-value { color: var(--text); font-weight: 600; margin-left: 4px; }

/* Modals & Wizard */
.modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: none; align-items: flex-end; justify-content: center;
}
.modal-overlay.active { display: flex; }
@media (min-width: 640px) {
  .modal-overlay { align-items: center; }
}
.wizard-container, .modal-container {
  width: 100%; max-width: 560px; max-height: 92vh;
  background: var(--bg); border-radius: 16px 16px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
}
.modal-container {
  max-height: 85vh;
}
/* Wizard takes full screen on mobile for no-scroll experience */
.wizard-container {
  max-height: 100vh; max-height: 100dvh;
  max-width: 100%; border-radius: 0;
  height: 100vh; height: 100dvh;
}
@media (min-width: 640px) {
  .modal-container { border-radius: 16px; max-height: 85vh; }
  .wizard-container {
    max-width: 90vw; border-radius: 12px;
    height: 94vh; height: 94dvh;
  }
}
@media (min-width: 768px) {
  .modal-container { max-width: 520px; }
  .wizard-container {
    max-width: 90vw;
    height: 96vh; height: 96dvh;
  }
}
@media (min-width: 1200px) {
  .wizard-container { max-width: 1000px; }
}
.wizard-header, .modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.wizard-header h2 { font-size: 14px; font-weight: 600; color: var(--text-muted); }
.modal-header h2 { font-size: 18px; font-weight: 700; color: var(--cream); }
.wizard-progress {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 8px 16px; flex-shrink: 0;
}
.progress-step {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--text-dim);
}
.progress-step span {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--border); font-weight: 700; font-size: 12px;
}
.progress-step.active span { background: var(--cream); color: var(--navy-dark); border-color: var(--cream); }
.progress-step.complete span { background: var(--green); color: #fff; border-color: var(--green); }
.progress-step label { display: none; }
@media (min-width: 400px) { .progress-step label { display: inline; } }
.progress-step + .progress-step::before {
  content: ''; display: block; width: 20px; height: 1.5px;
  background: var(--border); margin-right: 4px;
}
.progress-step.active + .progress-step::before,
.progress-step.complete + .progress-step::before { background: var(--cream-muted); }

/* Close buttons inside modals/wizards — high visibility on dark backgrounds */
.modal-header .header-btn,
.wizard-header .header-btn {
  color: #F2E5b3;
  min-width: 24px; min-height: 24px;
  padding: 6px;
  border-radius: 6px;
}
.modal-header .header-btn:hover,
.wizard-header .header-btn:hover {
  background: rgba(242,229,179,0.15);
  color: #fff;
}

.wizard-body, .modal-body {
  flex: 1; overflow-y: auto; padding: 16px; min-height: 0; position: relative;
}
/* When wizard body contains a map step, use flex layout to fill space */
.wizard-body {
  display: flex; flex-direction: column;
}
.wizard-body > button,
.wizard-body > .form-group,
.wizard-body > .form-hint,
.wizard-body > p,
.wizard-body > .analysis-step,
.wizard-body > .depth-input-tabs,
.wizard-body > .review-section {
  flex-shrink: 0;
}
#bath-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.wizard-footer, .modal-footer {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; border-top: 1px solid var(--border); flex-shrink: 0;
  padding-bottom: calc(10px + var(--safe-bottom));
  position: relative; z-index: 2;
}
.wizard-footer .btn-primary { flex: 1; min-height: 48px; cursor: pointer !important; user-select: none; position: relative; z-index: 3; }
.wizard-footer .btn-secondary { flex: 0 0 auto; min-height: 48px; cursor: pointer !important; user-select: none; position: relative; z-index: 3; }
/* When Back button is hidden, Next fills entire footer width */
.wizard-footer .btn-secondary.hidden + .btn-primary { width: 100%; }

/* Wizard map (step 2 — draw shoreline) */
.wizard-map-container {
  width: 100%; min-height: 200px; flex: 1;
  border-radius: 8px; overflow: hidden;
  border: 1px solid var(--border);
  position: relative;
}
/* Ensure ArcGIS MapView fills the container completely */
.wizard-map-container .esri-view {
  width: 100% !important; height: 100% !important;
}
.wizard-map-container #map-container {
  position: absolute; inset: 0;
}
.wizard-map-instructions {
  font-size: 13px; color: var(--text-muted); text-align: center;
  padding: 4px 8px; line-height: 1.4; flex-shrink: 0;
}
.wizard-map-instructions strong { color: var(--cream); }

/* Form fields */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block; font-size: 13px; font-weight: 600; color: var(--text-muted);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.3px;
}
.form-input, .form-textarea, .form-select {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text); font-family: inherit; font-size: 15px;
  transition: border-color 0.15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--cream);
}
.form-input::placeholder { color: var(--text-dim); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: 4px; }

/* WQ entry form — sectioned layout */
.wq-section { margin-bottom: 16px; }
.wq-section-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 600; color: var(--cream);
  text-transform: uppercase; letter-spacing: 0.4px;
  padding: 8px 0; cursor: pointer; user-select: none;
}
.wq-section-header--static { cursor: default; }
.wq-section-header:not(.wq-section-header--static):hover { color: var(--text); }
.wq-section-chevron {
  display: inline-block; width: 14px; text-align: center;
  font-size: 11px; transition: transform 0.15s;
}
.wq-section-body { padding-bottom: 4px; }
.wq-section + .wq-section { border-top: 1px solid var(--border); padding-top: 12px; }

/* 3-column grid for parameter inputs */
.wq-param-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
}
@media (max-width: 600px) {
  .wq-param-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
  .wq-param-grid { grid-template-columns: 1fr; }
}

/* Individual parameter field */
.wq-param-field { display: flex; flex-direction: column; gap: 4px; }
.wq-param-label-text {
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wq-param-input-wrap { display: flex; align-items: center; gap: 6px; }
.wq-param-input {
  width: 100%; padding: 8px 10px; font-size: 14px; text-align: right;
}
.wq-param-unit {
  font-size: 11px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0;
}

/* Analysis step (auto-processing indicator) */
.analysis-step {
  display: flex; align-items: center; gap: 12px;
  padding: 14px; margin-bottom: 10px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.analysis-spinner {
  width: 20px; height: 20px; flex-shrink: 0;
  border: 2px solid var(--border); border-top-color: var(--cream);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.analysis-check {
  width: 20px; height: 20px; flex-shrink: 0;
  color: var(--success); display: flex; align-items: center; justify-content: center;
}
.analysis-info { flex: 1; }
.analysis-label { font-size: 14px; font-weight: 600; color: var(--text); }
.analysis-detail { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Depth points / bathymetry input */
.depth-input-mode { display: flex; gap: 8px; margin-bottom: 16px; }
.depth-mode-btn {
  flex: 1; padding: 10px; border: 1.5px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text-muted); font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; text-align: center;
  transition: all 0.15s;
}
.depth-mode-btn.active { border-color: var(--cream); color: var(--cream); background: rgba(242,229,179,0.08); }

/* Depth split layout — map and points side-by-side on desktop */
.depth-split-layout {
  display: flex; flex-direction: column; flex: 1; gap: 12px; min-height: 0;
}
.depth-split-layout .wizard-map-container { min-height: 180px; flex: 1; }
.depth-panel-right {
  flex-shrink: 0; overflow-y: auto; max-height: 140px;
}
@media (min-width: 768px) {
  .depth-split-layout { flex-direction: row; }
  .depth-split-layout .wizard-map-container { flex: 3; min-height: 0; }
  .depth-panel-right { flex: 1; min-width: 160px; max-width: 220px; max-height: none; overflow-y: auto; }
}
.depth-points-list { overflow-y: auto; }
.depth-point-row {
  display: flex; align-items: center; gap: 6px; padding: 6px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
}
.depth-point-num { width: 20px; color: var(--text-dim); text-align: center; flex-shrink: 0; font-size: 11px; }
.depth-point-depth { width: 56px; text-align: center; padding: 4px 6px; font-size: 13px; }
.depth-point-remove { background: none; border: none; color: var(--danger); cursor: pointer; padding: 4px; flex-shrink: 0; }
.depth-point-count { font-size: 12px; color: var(--text-muted); font-weight: 600; margin-bottom: 6px; }

/* Batch import */
.batch-import-area {
  width: 100%; min-height: 120px; padding: 10px 14px; border-radius: 8px;
  border: 1.5px dashed var(--border); background: var(--bg-card);
  color: var(--text); font-family: 'Courier New', monospace; font-size: 13px;
  resize: vertical;
}
.batch-import-area:focus { outline: none; border-color: var(--cream); }
.batch-import-hint { font-size: 12px; color: var(--text-dim); margin-top: 6px; line-height: 1.5; }

/* Summary / review cards */
.summary-section { margin-bottom: 20px; }
.summary-section h3 { font-size: 14px; font-weight: 700; color: var(--cream); margin-bottom: 10px; }
.summary-grid {
  display: table; width: auto; border-collapse: collapse;
}
.summary-item {
  display: table-row;
}
.summary-item-label {
  display: table-cell; padding: 7px 16px 7px 0; font-size: 15px; color: var(--text-muted);
  white-space: nowrap; border-bottom: 1px solid var(--border); vertical-align: baseline;
}
.summary-item-value {
  display: table-cell; padding: 7px 0; font-size: 15px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border); vertical-align: baseline; text-align: left;
}
.summary-item:last-child .summary-item-label,
.summary-item:last-child .summary-item-value { border-bottom: none; }
.summary-map-preview {
  width: 100%; height: 200px; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border); margin-bottom: 12px;
}

/* Pond detail view */
.pond-detail-header {
  padding: 8px 16px; border-bottom: 1px solid var(--border);
}
.pond-detail-name { font-size: 22px; font-weight: 700; color: var(--cream); }
.pond-detail-location { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.pond-detail-map { width: 100%; height: 200px; border-bottom: 1px solid var(--border); }
.pond-detail-tabs {
  display: flex; border-bottom: 1px solid var(--border);
}
.pond-tab {
  flex: 1; padding: 10px; text-align: center;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: #fff; font-family: inherit; font-size: 13px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.pond-tab.active { color: var(--cream); border-bottom-color: var(--cream); }
.pond-tab-content { padding: 16px; }

/* Soil data display */
.soil-overview { margin-bottom: 16px; }
.soil-series-card {
  padding: 14px; margin-bottom: 10px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.soil-series-name { font-size: 15px; font-weight: 700; color: var(--cream); }
.soil-series-pct { font-size: 12px; color: var(--text-muted); }
.soil-layer-row {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: 13px; border-bottom: 1px solid rgba(255,255,255,0.04);
}
.soil-layer-label { color: var(--text-muted); }
.soil-layer-value { color: var(--text); font-weight: 600; }

/* Toast notifications */
.toast {
  position: fixed; bottom: calc(var(--tab-height) + 16px + var(--safe-bottom));
  left: 50%; transform: translateX(-50%);
  padding: 10px 20px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  color: var(--text); font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  z-index: 600; opacity: 0; transition: opacity 0.3s;
  max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; }
.toast.toast-success { border-color: var(--success); }
.toast.toast-error { border-color: var(--danger); }

/* Empty states */
.empty-state {
  text-align: center; padding: 48px 24px;
}
.empty-state p { font-size: 15px; color: var(--text-muted); margin-bottom: 6px; }
.text-muted { color: var(--text-dim); }

/* ArcGIS widget overrides — dark theme consistency */
.esri-search { border-radius: 8px !important; }
.esri-widget { font-family: Tahoma, 'Segoe UI', system-ui, sans-serif !important; }
.esri-search__input { font-size: 14px !important; }

/* Watershed 2-column layout — mobile: vertical stack, desktop (768px+): side-by-side grid */
.ws-layout { display: flex; flex-direction: column; gap: 16px; align-items: start; }

/* ============================================
   Responsive Desktop Layout (768px+)
   Tab bar → left side rail, content fills space
   ============================================ */
@media (min-width: 768px) {
  /* App becomes horizontal: sidebar + content */
  .app {
    flex-direction: row;
  }

  /* Header becomes a thin top bar spanning the content area only */
  .app-header {
    position: absolute; top: 0; left: 72px; right: 0;
    height: var(--header-height);
    z-index: 100;
  }

  /* Side navigation rail */
  .tab-bar {
    flex-direction: column;
    justify-content: flex-start;
    width: 72px; height: 100%;
    border-top: none; border-right: 1px solid var(--border);
    padding: 16px 0 0; gap: 4px;
    order: -1; /* left side */
  }
  .tab-item {
    flex: none;
    padding: 12px 0;
    border-radius: 8px;
    margin: 0 6px;
    font-size: 10px;
  }
  .tab-item:hover { background: rgba(255,255,255,0.04); }

  /* Main content area gets header offset */
  .main-content {
    padding-top: var(--header-height);
    flex: 1;
  }

  /* Map fills all available space */
  .map-container { width: 100%; height: 100%; }
  .map-fab { top: 12px; right: 12px; }

  /* Welcome centers nicely */
  .welcome-container { padding-top: 80px; max-width: 520px; }

  /* Ponds list — wider and can use card grid */
  .ponds-list { max-width: 720px; margin: 0 auto; padding: 16px 24px; }
  .pond-card { padding: 16px; }

  /* WQ content */
  .wq-content { max-width: 720px; margin: 0 auto; padding: 16px 24px; }
  .wq-pond-filter { max-width: 720px; margin: 0 auto; padding: 16px 24px 0; }

  /* Profile */
  .profile-content { max-width: 560px; padding: 24px; }

  /* Pond detail — more padding on desktop */
  .pond-detail-header { padding: 12px 24px; }
  .pond-detail-stats { display: none; } /* Data consolidated into overview table on desktop */
  .pond-detail-tabs { padding: 8px 24px; }
  .pond-detail-section { padding: 16px 24px; max-width: 900px; margin-left: auto; margin-right: auto; }
  .pond-detail-map { height: 280px; }
  .bath-snapshot-host { min-height: 220px; max-width: 600px; margin-left: auto; margin-right: auto; }
  .bath-snapshot-img { max-height: 380px; }
  .overview-map-section,
  .contour-map-section { max-width: 600px; margin-left: auto; margin-right: auto; }
  .landcover-bars { max-width: 600px; }

  /* Top stats bar — bump font size on desktop */
  .stat-value { font-size: 22px; }
  .stat-label { font-size: 15px; }

  /* View headers — keep full-width border, pad content */
  .view-header { padding: 16px 24px 12px; }

  /* Toast above sidebar */
  .toast { bottom: 24px; left: calc(72px + 50%); transform: translateX(-50%); }
}

/* Wider desktops — multi-column layouts */
@media (min-width: 1024px) {
  .tab-bar { width: 80px; }
  .app-header { left: 80px; }
  .toast { left: calc(80px + 50%); transform: translateX(-50%); }

  /* Pond list cards in 2-column grid */
  .ponds-list { max-width: 900px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .ponds-list .empty-state { grid-column: 1 / -1; }
  .pond-card { margin-bottom: 0; }

  /* WQ reading cards in 2-column grid */
  .wq-content { max-width: 900px; }

  /* Welcome */
  .welcome-container { padding-top: 100px; max-width: 560px; }

  /* Profile stats can be wider */
  .profile-content { max-width: 640px; }
  .profile-stats { gap: 16px; }

  /* Watershed tab: land cover + soil side by side */
  .ws-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .ws-layout-full { grid-column: 1 / -1; }

  /* Inside the 2-col layout, constrain child grids to fit narrower columns */
  .ws-layout .soil-card-list {
    display: flex; flex-direction: column; gap: 10px;
    grid-template-columns: none;
  }
  .ws-layout .landcover-bars { max-width: none; }
}

/* Large desktops */
@media (min-width: 1440px) {
  .ponds-list { max-width: 1100px; grid-template-columns: 1fr 1fr 1fr; }
  .wq-content { max-width: 1100px; }

  /* Pond detail — wider summary tables get max width */
  .summary-grid { max-width: 420px; }
}

/* iOS overscroll */
.main-content { -webkit-overflow-scrolling: touch; }

/* ─── Additional component styles ─── */

/* Depth input tabs (Step 4 wizard) */
.depth-input-tabs {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.depth-tab {
  flex: 1; padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 8px;
  background: transparent; color: var(--text-muted); font-family: inherit;
  font-size: 13px; font-weight: 600; cursor: pointer; text-align: center;
  transition: all 0.15s;
}
.depth-tab.active { border-color: var(--cream); color: var(--cream); background: rgba(242,229,179,0.08); }
.depth-panel {}
.depth-point-count {
  font-size: 13px; color: var(--text-muted); text-align: center; padding: 6px 0;
}

/* Form row layout */
.form-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.form-label-inline {
  font-size: 13px; color: var(--text-muted); flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.form-input-sm { width: 100px; flex-shrink: 0; padding: 8px 10px; font-size: 14px; text-align: right; }
.form-select-sm { flex: 1; padding: 8px 10px; font-size: 13px; }

/* WQ tags in reading cards */
.wq-reading-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px;
}
.wq-reading-time { font-size: 12px; color: var(--text-dim); }
.wq-reading-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wq-tag {
  padding: 3px 8px; border-radius: 5px; font-size: 11px;
  background: var(--bg-surface); color: var(--text-muted);
}
.wq-tag-more { background: rgba(242,229,179,0.1); color: var(--cream-muted); }

/* Review step (Step 5 wizard) */
.review-section {
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.review-section:last-child { border-bottom: none; }
.review-heading { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.review-value { font-size: 15px; color: var(--text); font-weight: 600; }
.review-detail { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* Pond detail sections */
.pond-detail-stats {
  display: flex; gap: 6px; padding: 4px 16px 6px; border-bottom: 1px solid var(--border);
}

/* Overview action bar and data panel */
.overview-actions {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: center;
  padding: 12px 0 4px; margin-bottom: 8px;
}
.overview-data-panel {
  max-width: 480px; margin: 0 auto; padding: 0 8px;
}
.pond-detail-notes { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.pond-detail-tabs {
  display: flex; gap: 4px; padding: 8px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.detail-tab {
  flex: 1; padding: 6px 4px; text-align: center;
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: 8px;
  color: #fff; font-family: inherit; font-size: 12px;
  font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.detail-tab:hover { background: var(--bg-surface); color: var(--cream); }
.detail-tab.active {
  background: var(--green); border-color: var(--green-light);
  color: #fff;
}
.pond-detail-section { padding: 12px 16px; }

/* Soil cards (pond detail) */
.soil-card {
  padding: 10px 12px; margin-bottom: 8px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.soil-card-header {
  display: flex; flex-direction: column; gap: 1px; margin-bottom: 5px;
}
.soil-card-header strong { font-size: 15px; color: var(--cream); }
.soil-pct { font-size: 12px; color: var(--text-muted); }
.soil-card-body {}
.soil-row {
  display: flex; align-items: baseline; padding: 3px 0;
  font-size: 12px; border-bottom: 1px solid rgba(255,255,255,0.04);
  gap: 8px;
}
.soil-row span:first-child { color: var(--text-muted); white-space: nowrap; min-width: 0; }
.soil-row span:first-child::after { content: ':'; }
.soil-row span:last-child { color: var(--text); font-weight: 600; }

/* Depth stats grid — 2-column on desktop */
.depth-stats-grid {
  display: table; width: auto; border-collapse: collapse;
}
@media (min-width: 768px) {
  .depth-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px;
  }
  .depth-stats-grid .summary-item { display: flex; justify-content: space-between; border-bottom: 1px solid var(--border); padding: 7px 0; }
  .depth-stats-grid .summary-item-label { display: inline; padding: 0; border-bottom: none; }
  .depth-stats-grid .summary-item-value { display: inline; padding: 0; border-bottom: none; text-align: right; }
}

/* Depth list (pond detail bathymetry) */
.depth-list { }
.depth-list-item {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid var(--border); font-size: 13px;
  gap: 16px;
}

/* Bathymetry map */
.contour-map-section {
  margin: 12px 0 16px;
  padding: 12px;
  background: var(--bg-card);
  border-radius: 10px;
  border: 1px solid var(--border);
}
/* Overview map section on pond detail */
.overview-map-section {
  margin-bottom: 16px;
}

/* Bathymetry snapshot image host */
.bath-snapshot-host {
  width: 100%;
  min-height: 150px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg);
}
.bath-snapshot-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 350px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity 0.15s;
}
.bath-snapshot-img:hover {
  opacity: 0.9;
}
.contour-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 10px;
  padding: 8px 0;
}
.contour-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
}
.contour-legend-line {
  display: inline-block;
  width: 24px;
  height: 3px;
  border-radius: 2px;
}

/* Loading inline */
.loading-inline {
  text-align: center; padding: 32px 16px;
  font-size: 14px; color: var(--text-dim);
}

/* ─── Watershed Tab ─── */

/* Analysis progress indicator */
.analysis-progress {
  padding: 24px 0;
}
.analysis-step {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; font-size: 14px; color: var(--text-dim);
}
.analysis-step.active { color: var(--cream); }
.analysis-step.active .step-spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid var(--border); border-top-color: var(--cream);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
.analysis-step.complete { color: var(--green-light); }
.analysis-step .step-icon { font-size: 10px; width: 18px; text-align: center; }

/* Land cover horizontal bars */
.landcover-bars { margin-top: 8px; }
.landcover-bar-row {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 0; font-size: 13px;
}
.landcover-label {
  width: 100px; flex-shrink: 0;
  color: var(--text-muted); font-size: 12px;
  text-align: right;
}
.landcover-bar-track {
  flex: 1; height: 14px;
  background: var(--bg-surface); border-radius: 4px;
  overflow: hidden;
}
.landcover-bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.5s ease;
}
.landcover-pct {
  width: 44px; flex-shrink: 0;
  font-size: 12px; color: var(--text);
  font-weight: 600; text-align: right;
}

/* Stream list */
.stream-list { margin-top: 8px; }
.stream-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 13px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.stream-item span:first-child { color: var(--text); font-weight: 600; }

/* Summary sections (reusable) */
.summary-section h3 {
  font-size: 14px; color: var(--cream);
  margin-bottom: 8px; font-weight: 600;
}

.ws-col { min-width: 0; }

/* ── Depth Entry Toolbar (map overlay) ──────────────── */
.depth-toolbar {
  position: absolute;
  top: 10px; right: 10px;
  z-index: 30;
  background: rgba(11, 15, 36, 0.94);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  width: 220px;
  max-height: calc(100% - 24px);
  display: flex; flex-direction: column;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.depth-toolbar-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 4px;
}
.depth-toolbar-header strong { font-size: 14px; color: var(--cream); }
.depth-toolbar-count { font-size: 12px; color: var(--text-muted); }
.depth-toolbar-hint { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; line-height: 1.4; }
.depth-toolbar-list {
  flex: 1; overflow-y: auto; max-height: 280px;
  margin-bottom: 10px;
  border-top: 1px solid var(--border);
  padding-top: 6px;
}
.depth-toolbar-actions { display: flex; gap: 8px; }
.depth-toolbar-actions .btn-primary,
.depth-toolbar-actions .btn-secondary { flex: 1; font-size: 13px; }

/* ── Edit Shoreline Toolbar ──────────────────────────── */
.edit-toolbar {
  position: absolute;
  top: 10px; left: 50%; transform: translateX(-50%);
  z-index: 30;
  background: rgba(11, 15, 36, 0.92);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 16px;
  max-width: 420px;
  width: calc(100% - 24px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.edit-toolbar-instructions {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
  line-height: 1.5;
  text-align: center;
}
.edit-toolbar-instructions strong {
  color: var(--cream);
}
.edit-toolbar-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.edit-toolbar-actions .btn-primary {
  min-width: 130px;
}
.edit-toolbar-actions .btn-secondary {
  min-width: 90px;
}

/* ── Map Layer Toggle Panel ───────────────────────── */
.map-layer-panel {
  position: absolute;
  bottom: 80px; left: 10px;
  z-index: 20;
  background: rgba(11, 15, 36, 0.88);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
  font-size: 13px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}
.map-layer-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--cream);
  font-weight: 600; font-size: 12px;
  text-transform: uppercase; letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  user-select: none;
}
.layer-panel-chevron {
  font-size: 10px; color: var(--text-muted);
}
.map-layer-panel-body {
  padding: 6px 8px;
}
.layer-toggle-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 4px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  border-radius: 4px;
  transition: background 0.15s;
}
.layer-toggle-row:hover {
  background: rgba(255,255,255,0.05);
}
.layer-toggle-row input[type="checkbox"] {
  width: 14px; height: 14px;
  accent-color: var(--cream);
  cursor: pointer;
  flex-shrink: 0;
}
.layer-swatch {
  display: inline-block;
  width: 16px; height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Multi-soil card list in watershed tab */
.soil-card-list {
  display: flex; flex-direction: column; gap: 10px;
}
.soil-card-list .soil-card {
  margin-bottom: 0;
}
.soil-card-list .soil-card-header {
  display: flex; flex-direction: row; justify-content: space-between; align-items: center; gap: 8px;
}
.soil-card-list .soil-card-header strong {
  font-size: 13px; line-height: 1.3; min-width: 0;
  overflow: hidden; text-overflow: ellipsis;
}
/* Compact soil cards — cap width so rows don't stretch across full screen */
.soil-card { max-width: 420px; }
.soil-card-area-badge {
  background: var(--navy-light);
  color: var(--cream);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}
.soil-weighted-card {
  border: 1px dashed var(--cream-muted);
  background: rgba(242, 229, 179, 0.04);
}
.soil-weighted-card .soil-card-header {
  color: var(--cream);
}

/* Desktop: multi-column soil card grid */
@media (min-width: 768px) {
  .soil-card-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  /* Weighted average card spans full width */
  .soil-card-list .soil-weighted-card {
    grid-column: 1 / -1;
  }
  .map-layer-panel {
    bottom: auto; top: 80px; left: 10px;
  }
}
@media (min-width: 1200px) {
  .soil-card-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ═══════════════════════════════════════════════════════════════
   Soil Interpretation Cards — severity tiers, horizon profile,
   limitation details
   ═══════════════════════════════════════════════════════════════ */

/* Section titles within soil tab */
.soil-section-title {
  font-size: 13px; color: var(--cream);
  font-weight: 600; margin: 14px 0 6px;
  letter-spacing: 0.3px;
}
.soil-section-title:first-child { margin-top: 0; }

/* ── Soil layout (profile on top, assessment below) ── */
.soil-two-col {
  display: flex; flex-direction: column; gap: 16px; margin-top: 10px;
  max-width: 700px;
}
.soil-two-col-profile { flex: 0 0 auto; }
.soil-two-col-tiers { flex: 0 0 auto; max-width: 500px; }
.soil-two-col-profile .horizon-profile-section { margin-top: 0; }
.soil-two-col-tiers .severity-overview { margin-top: 0; }

/* ── Severity Tier Overview ──────────────────────────── */
.severity-overview { margin-top: 10px; }

.severity-tier-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  max-width: 500px;
}

.severity-tier-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px;
  border: 1px solid;
  border-radius: 6px;
}

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

.severity-tier-content { min-width: 0; }

.severity-tier-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.severity-tier-value {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  margin-top: 1px;
}

/* ── Horizon Profile Visualization ───────────────────── */
.horizon-profile-section { margin-top: 10px; }

.horizon-profile-container {
  display: flex;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 10px 16px;
  overflow: visible;
  min-height: 0;
}

/* Left: depth axis */
.horizon-depth-axis {
  position: relative;
  width: 48px;
  flex-shrink: 0;
  padding-bottom: 8px;
}

.horizon-depth-tick {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  align-items: center;
  transform: translateY(-50%);
}
.horizon-depth-tick span {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  padding-right: 4px;
}
.horizon-depth-tick::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Center: stacked layers */
.horizon-layers-column {
  position: relative;
  width: 100px;
  flex-shrink: 0;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

.horizon-layer {
  position: absolute;
  left: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid rgba(0,0,0,0.25);
  transition: opacity 0.15s;
  cursor: default;
}
.horizon-layer:hover {
  opacity: 0.85;
}

.horizon-layer-label {
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.6);
  line-height: 1.2;
}
.horizon-layer-texture {
  font-size: 9px;
  color: rgba(255,255,255,0.8);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
  line-height: 1.1;
  text-align: center;
  padding: 0 2px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Bedrock indicator line */
.horizon-bedrock-line {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2.5px dashed #7a7a7a;
  z-index: 2;
  display: flex;
  align-items: flex-start;
}
.horizon-bedrock-label {
  position: absolute;
  left: calc(100% + 6px);
  top: -1px;
  font-size: 10px;
  color: #999;
  white-space: nowrap;
  font-weight: 600;
  background: var(--bg-card);
  padding: 0 3px;
}

/* Water table indicator line */
.horizon-water-table-line {
  position: absolute;
  left: 0; right: 0;
  height: 0;
  border-top: 2.5px dashed #2196F3;
  z-index: 2;
  display: flex;
  align-items: flex-start;
}
.horizon-water-table-label {
  position: absolute;
  left: calc(100% + 6px);
  top: -1px;
  font-size: 10px;
  color: #2196F3;
  white-space: nowrap;
  font-weight: 600;
  background: var(--bg-card);
  padding: 0 3px;
}

/* Right: horizon detail rows — positioned to align with visual layers */
.horizon-detail-column {
  flex: 1;
  padding-left: 10px;
  min-width: 0;
  max-width: 400px;
  position: relative;
}

.horizon-detail-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 10px;
  align-items: flex-start;
  padding: 3px 0;
  box-sizing: border-box;
  overflow: hidden;
}

.horizon-detail-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--cream);
  min-width: 28px;
}
.horizon-detail-depth {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.horizon-detail-prop {
  font-size: 11px;
  color: var(--text);
  white-space: nowrap;
}

/* Water table / bedrock annotations in the detail column */
.horizon-detail-annotation {
  position: absolute;
  left: 10px;
  right: 0;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  transform: translateY(-50%);
}

/* ── Limitation Detail Cards ─────────────────────────── */
.limitation-details { margin-top: 10px; }
details.limitation-details > summary { cursor: pointer; list-style: none; }
details.limitation-details > summary::-webkit-details-marker { display: none; }
.soil-section-toggle { display: flex; align-items: center; gap: 8px; }
.soil-section-toggle::before {
  content: '\25B6'; font-size: 9px; color: var(--text-dim);
  transition: transform 0.2s;
}
details[open].limitation-details > .soil-section-toggle::before { transform: rotate(90deg); }
.toggle-hint { font-size: 10px; color: var(--text-dim); font-weight: 400; }
details[open].limitation-details > .soil-section-toggle .toggle-hint { display: none; }

.limitation-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 8px;
  /* border-left set inline by JS */
}

.limitation-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.limitation-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.limitation-card-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.limitation-card-body p {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin-bottom: 5px;
}
.limitation-card-body p:last-child { margin-bottom: 0; }

/* ── Responsive: stack horizon profile vertically on small screens ── */
@media (max-width: 479px) {
  .horizon-profile-container {
    flex-direction: column;
    padding: 12px 8px;
  }
  .horizon-depth-axis {
    display: none; /* hide axis on very small screens, layers have tooltips */
  }
  .horizon-layers-column {
    width: 100%;
    height: 200px !important;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid var(--border);
    margin-bottom: 12px;
  }
  .horizon-detail-column {
    padding-left: 0;
    max-height: none;
    /* On mobile, revert to stacked layout instead of absolute positioning */
    height: auto !important;
  }
  .horizon-detail-column .horizon-detail-row {
    position: static !important;
    height: auto !important;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .horizon-detail-column .horizon-detail-row:last-of-type { border-bottom: none; }
  .horizon-detail-column .horizon-detail-annotation {
    position: static;
    transform: none;
    padding: 4px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
  }
  .horizon-bedrock-label,
  .horizon-water-table-label {
    left: auto;
    right: 4px;
    font-size: 9px;
  }
}

/* ── Soil Action Buttons & Report ──────────────────────── */
.soil-actions {
  margin-top: 14px; text-align: center;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.soil-action-btns {
  display: flex; gap: 8px; justify-content: center; margin-top: 6px;
}
.report-loading {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 24px 16px; color: var(--text-muted); font-size: 13px;
}

/* ── Report generation animation ──────────────────────── */
.report-gen-anim {
  display: flex; flex-direction: column; align-items: center;
  padding: 28px 16px 20px; gap: 14px;
}
.rga-drop-wrap {
  width: 90px; height: 120px; position: relative;
  filter: drop-shadow(0 4px 16px rgba(52,152,219,0.25));
}
.rga-drop-svg { width: 100%; height: 100%; }

/* AI shimmer sweep across the drop */
.rga-shimmer {
  animation: rgaShimmer 2.8s ease-in-out infinite;
}
@keyframes rgaShimmer {
  0% { x: -120; }
  100% { x: 240; }
}

/* Sparkle particles float up through the water */
.rga-spark {
  opacity: 0;
  animation: rgaSpark 2.4s ease-in-out infinite;
}
.rga-spark-2 { animation-delay: 0.6s; }
.rga-spark-3 { animation-delay: 1.2s; }
.rga-spark-4 { animation-delay: 1.8s; }
@keyframes rgaSpark {
  0%, 100% { opacity: 0; transform: scale(0.5) translateY(0); }
  20% { opacity: 1; transform: scale(1.2) translateY(-3px); }
  40% { opacity: 0.7; transform: scale(0.8) translateY(-8px); }
  60% { opacity: 0; transform: scale(0.3) translateY(-14px); }
}

/* Drop outline gentle pulse */
.rga-drop-outline {
  animation: rgaPulse 3s ease-in-out infinite;
}
@keyframes rgaPulse {
  0%, 100% { stroke-opacity: 0.2; }
  50% { stroke-opacity: 0.5; }
}

/* Status text */
.rga-status {
  display: flex; align-items: center; gap: 8px;
}
.rga-status-text {
  font-size: 13px; color: var(--text-muted);
}
.rga-hint {
  font-size: 11px; color: var(--text-dim);
}

/* Generated report */
.soil-report {
  margin-top: 14px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; overflow: hidden;
}
.soil-report-header {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px; padding-bottom: 6px; border-bottom: 1px solid var(--border);
}
.soil-report-header .soil-section-title { margin: 0; }
.soil-report-body h4.report-section-header {
  font-size: 12px; font-weight: 700; color: var(--cream);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin: 14px 0 4px; padding-top: 8px;
  border-top: 1px solid rgba(255,255,255,0.05);
}
.soil-report-body h4.report-section-header:first-child {
  margin-top: 0; padding-top: 0; border-top: none;
}
.soil-report-body p {
  font-size: 12px; color: var(--text-muted); line-height: 1.55; margin-bottom: 6px;
}
.soil-report-body p:last-child { margin-bottom: 0; }
.report-cta {
  margin-top: 12px; padding: 12px 14px;
  background: rgba(28, 66, 32, 0.15); border: 1px solid rgba(28, 66, 32, 0.35);
  border-radius: 8px; text-align: center;
}
.report-cta p { font-size: 13px; color: var(--text); font-weight: 600; margin-bottom: 8px; }
.report-cta-links { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.report-cta-links a { text-decoration: none; font-size: 12px; }

.soil-report-actions {
  display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
  margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--border);
}

/* ── Water Quality: Color-Coded Status ───────────────── */
.wq-legend {
  display: flex; gap: 14px; align-items: center; flex-wrap: wrap;
  padding: 8px 12px; margin-bottom: 12px;
  background: var(--bg-surface); border-radius: 6px;
  font-size: 12px; color: var(--text-muted);
}
.wq-legend-item {
  display: flex; align-items: center; gap: 5px;
}
.wq-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
.wq-dot-good    { background: var(--success); }
.wq-dot-caution { background: var(--warning); }
.wq-dot-poor    { background: var(--danger); }
.wq-dot-neutral { background: var(--text-dim); }

/* Status color on individual parameter tags */
.wq-param.wq-status-good .wq-param-value {
  color: #2ecc71; font-weight: 600;
}
.wq-param.wq-status-caution .wq-param-value {
  color: #f39c12; font-weight: 600;
}
.wq-param.wq-status-poor .wq-param-value {
  color: #e74c3c; font-weight: 600;
}
.wq-param.wq-status-neutral .wq-param-value {
  color: var(--text-muted);
}

/* Status dot before param label */
.wq-param.wq-status-good::before,
.wq-param.wq-status-caution::before,
.wq-param.wq-status-poor::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.wq-param.wq-status-good::before    { background: var(--success); }
.wq-param.wq-status-caution::before { background: var(--warning); }
.wq-param.wq-status-poor::before    { background: var(--danger); }

/* ── Water Quality: Time-Series Charts ───────────────── */
.wq-charts-container {
  margin-bottom: 20px; display: flex; flex-direction: column; gap: 12px;
}
.wq-chart-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.wq-chart-title {
  font-size: 13px; font-weight: 600; color: var(--cream);
  margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.3px;
}
.wq-chart-wrap {
  width: 100%; overflow: hidden;
}
.wq-chart-svg {
  width: 100%; height: auto; display: block;
}
.wq-chart-label {
  font-size: 9px; fill: var(--text-dim); font-family: Tahoma, sans-serif;
}
.wq-chart-unit {
  font-size: 8px; fill: var(--text-muted); font-family: Tahoma, sans-serif;
}
.wq-chart-legend {
  display: flex; gap: 16px; flex-wrap: wrap;
  padding: 8px 0 2px; font-size: 12px; color: var(--text-muted);
}
.wq-chart-legend-item {
  display: flex; align-items: center; gap: 5px;
}
.wq-chart-legend-swatch {
  width: 14px; height: 3px; border-radius: 2px; flex-shrink: 0;
}

/* ── P2.4 Mobile: prevent back button from overlapping zoom controls ── */
@media (max-width: 767px) {
  .map-back-bar { top: auto; bottom: 80px; right: 12px; }
}

/* ── P4.4 Desktop: larger navigation buttons ── */
@media (min-width: 769px) {
  .tab-item { padding: 14px 0; font-size: 12px; }
  .tab-item svg { width: 28px; height: 28px; }
  .back-btn { font-size: 15px; padding: 6px 14px 6px 10px; }
  .header-btn { padding: 8px; }
  .header-btn svg { width: 24px; height: 24px; }
}

/* ── P3.4 Dark mode: ESRI search bar visibility ── */
.esri-search {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border) !important;
}
.esri-search__input {
  background: var(--bg-surface) !important;
  color: var(--text) !important;
}
.esri-search__input::placeholder {
  color: var(--text-dim) !important;
}

/* ── P4.1 Non-clickable data should not look like buttons ── */
.summary-item,
.soil-row,
.profile-row,
.depth-list-item,
.wq-param,
.landcover-bar-row,
.severity-tier-item {
  cursor: default;
}

/* ── P2.5 Pond search input ── */
.pond-search-wrap {
  padding: 12px 12px 4px;
}
.pond-search-input {
  width: 100%; padding: 10px 14px; border-radius: 8px;
  border: 1.5px solid var(--border); background: var(--bg-card);
  color: var(--text); font-family: inherit; font-size: 14px;
}
.pond-search-input:focus { outline: none; border-color: var(--cream); }
.pond-search-input::placeholder { color: var(--text-dim); }
html.light-mode .pond-search-input { background: #fff; }
html.light-mode .pond-search-input:focus { border-color: #141b45; }

/* ── P4.3 Theme toggle label ── */
.theme-label {
  font-size: 11px; color: var(--navy); white-space: nowrap;
}

/* ── P5.4 WQ color-coded value indicators ── */
.wq-tag-good { background: rgba(39,174,96,0.15); color: #2ecc71; }
.wq-tag-warn { background: rgba(230,126,34,0.15); color: #e67e22; }
.wq-tag-bad { background: rgba(192,57,43,0.15); color: #e74c3c; }

/* ── P6.1 Treatments tab ── */
.treatment-card {
  padding: 14px; margin-bottom: 8px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.treatment-product { font-size: 15px; font-weight: 600; color: var(--text); }
.treatment-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.treatment-reminder {
  margin-top: 6px; padding: 6px 10px; border-radius: 6px;
  background: rgba(230,126,34,0.1); border: 1px solid rgba(230,126,34,0.3);
  font-size: 12px; color: var(--warning);
}

/* ── P5.4 Time-series chart container ── */
.wq-chart-container {
  margin: 16px 0; padding: 12px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; overflow-x: auto;
}
.wq-chart-container svg { width: 100%; height: auto; }

/* ── Contextual Help Tooltips ── */
.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 4px;
  font-size: 10px; font-style: normal; font-weight: 700;
  line-height: 1; vertical-align: middle;
  color: var(--text-dim); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 50%; cursor: help;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.help-icon:hover,
.help-icon-active {
  color: var(--cream); background: rgba(242,229,179,0.12);
  border-color: rgba(242,229,179,0.30);
}

.help-tooltip {
  position: absolute; z-index: 10000;
  max-width: 280px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.55;
  color: var(--text); background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  pointer-events: none; opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}
.help-tooltip.visible {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}

/* Arrow */
.help-tooltip::after {
  content: ''; position: absolute;
  width: 10px; height: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 1px;
  transform: rotate(45deg);
}
/* Arrow pointing down (tooltip above icon) */
.help-tooltip[data-arrow="bottom"]::after {
  bottom: -6px; left: 50%;
  margin-left: -5px;
  border-top: none; border-left: none;
}
/* Arrow pointing up (tooltip below icon) */
.help-tooltip[data-arrow="top"]::after {
  top: -6px; left: 50%;
  margin-left: -5px;
  border-bottom: none; border-right: none;
}

/* Light mode overrides */
html.light-mode .help-icon {
  color: #8a8fa8; background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}
html.light-mode .help-icon:hover,
html.light-mode .help-icon-active {
  color: #141b45; background: rgba(20,27,69,0.08);
  border-color: rgba(20,27,69,0.25);
}
html.light-mode .help-tooltip {
  background: #fff; border-color: #ddd; color: #333;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
html.light-mode .help-tooltip::after {
  background: #fff; border-color: #ddd;
}

/* ============================================
   Light Mode Theme
   Toggle via html.light-mode class
   ============================================ */
html.light-mode {
  --bg: #faf8f2;
  --bg-card: #ffffff;
  --bg-surface: #f0ede6;
  --text: #000000;
  --text-muted: #1a1a1a;
  --text-dim: #3a3a3a;
  --border: #d8d5cc;
  --navy-dark: #f0ede6;
  --navy: #e8e4da;
  --navy-light: #ddd9d0;
  --danger: #c0392b;
  --success: #1e8e4e;
  --warning: #d4700a;
}

/* Light mode: header uses white with dark text */
html.light-mode .main-content { background: var(--bg); }
html.light-mode .login-screen { background: var(--bg); }
html.light-mode .app-header { background: #fff; border-bottom-color: #d8d5cc; }
html.light-mode .header-title { color: #141b45; }
html.light-mode .header-brand { color: #141b45; }
html.light-mode .header-brand .brand-by { color: #666; }
html.light-mode .theme-label { color: #333; }
html.light-mode .header-btn { color: #333; }
html.light-mode .tab-item { color: #444; }
html.light-mode .tab-item svg { stroke: #444; }
html.light-mode .detail-tab { color: #333; background: #f0f0f0; border-color: #ccc; }
html.light-mode .detail-tab:hover { color: #000; background: #e8e8e8; }
html.light-mode .pond-tab { color: #333; }
html.light-mode .pond-tab:hover { color: #000; }
html.light-mode .header-btn:hover { background: rgba(0,0,0,0.06); color: #000; }
html.light-mode .btn-secondary:hover { background: rgba(0,0,0,0.05); }
html.light-mode .tab-item:hover { background: rgba(0,0,0,0.04); }
html.light-mode .layer-toggle-row:hover { background: rgba(0,0,0,0.04); }

html.light-mode .soil-layer-row,
html.light-mode .soil-row,
html.light-mode .stream-item,
html.light-mode .horizon-detail-column .horizon-detail-row,
html.light-mode .horizon-detail-column .horizon-detail-annotation {
  border-bottom-color: rgba(0,0,0,0.06);
}

/* Cards get subtle shadow */
html.light-mode .pond-card,
html.light-mode .soil-card,
html.light-mode .soil-series-card,
html.light-mode .wq-reading-card,
html.light-mode .limitation-card,
html.light-mode .analysis-step {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

html.light-mode .soil-weighted-card {
  border-color: #141b45;
  background: rgba(20,27,69,0.04);
}
html.light-mode .soil-card-area-badge {
  background: var(--bg-surface);
  color: #141b45;
}

html.light-mode .toast {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* Map overlays stay dark (satellite backdrop) */
html.light-mode .edit-toolbar,
html.light-mode .map-layer-panel,
html.light-mode .map-back-btn {
  --bg: #0b0f24; --bg-card: #141b45; --bg-surface: #1a2350;
  --text: #f0ede4; --text-muted: #9a9bb0; --text-dim: #6b6d82;
  --border: #2a3060; --navy-dark: #0d1230; --navy: #141b45;
  --cream: #F2E5b3;
  color: #f0ede4;
}
html.light-mode .edit-toolbar { background: rgba(11,15,36,0.92); }
html.light-mode .map-layer-panel { background: rgba(11,15,36,0.88); }

html.light-mode .report-cta {
  background: rgba(28,66,32,0.06);
  border-color: rgba(28,66,32,0.18);
}

/* Primary button → navy with white text */
html.light-mode .btn-primary { background: #141b45; color: #fff; }
html.light-mode .btn-primary:hover { background: #0d1230; }

/* Back button and header breadcrumbs — navy instead of invisible cream */
html.light-mode .back-btn { color: #141b45; }
html.light-mode .back-btn:hover { color: #0d1230; }

/* WQ section headers → navy in light mode */
html.light-mode .wq-section-header { color: #141b45; }
html.light-mode .wq-section-header:not(.wq-section-header--static):hover { color: #0d1230; }

/* Accent text → navy instead of cream */
html.light-mode .header-title,
html.light-mode .welcome-title,
html.light-mode .view-header h2,
html.light-mode .pond-detail-name,
html.light-mode .summary-section h3,
html.light-mode .soil-series-name,
html.light-mode .soil-card-header strong,
html.light-mode .soil-section-title,
html.light-mode .soil-report-body h4.report-section-header,
html.light-mode .modal-header h2 {
  color: #141b45;
}

html.light-mode .tab-item.active { color: #141b45; }
html.light-mode .tab-item.active svg { stroke: #141b45; }
html.light-mode .pond-tab.active { color: #141b45; border-bottom-color: #141b45; }
html.light-mode .detail-tab.active { background: var(--green); border-color: var(--green-light); color: #fff; }
html.light-mode .stat-value { color: #141b45; }
html.light-mode .badge { background: var(--green); color: #fff; }
html.light-mode .profile-link { color: #141b45; }
html.light-mode .profile-link:hover { color: #0d1230; }

/* Loading screen stays dark */
html.light-mode .loading-screen { background: #0b0f24; color: #f0ede4; }

/* Form inputs */
html.light-mode .form-input,
html.light-mode .form-textarea,
html.light-mode .form-select,
html.light-mode .pond-select,
html.light-mode .batch-import-area { background: #fff; border-color: var(--border); }
html.light-mode .form-input:focus,
html.light-mode .form-textarea:focus,
html.light-mode .form-select:focus,
html.light-mode .batch-import-area:focus { border-color: #141b45; }

html.light-mode .progress-step.active span { background: #141b45; color: #fff; border-color: #141b45; }
html.light-mode .analysis-spinner { border-top-color: #141b45; }
html.light-mode .loading-spinner { border-top-color: #141b45; }
html.light-mode .map-fab { background: #141b45; color: #fff; }
html.light-mode .map-fab:hover { background: #0d1230; }
html.light-mode .depth-mode-btn.active,
html.light-mode .depth-tab.active { border-color: #141b45; color: #141b45; background: rgba(20,27,69,0.08); }
html.light-mode .wizard-map-instructions strong { color: #141b45; }
html.light-mode .soil-report-body h4.report-section-header { border-top-color: rgba(0,0,0,0.05); }

/* ── Pond Profile Form ────────────────────────────────────── */
.profile-form-sections { display: flex; flex-direction: column; gap: 16px; }
.profile-section {
  padding: 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-surface);
}
.profile-section-title {
  font-size: 12px; font-weight: 600; color: var(--cream-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.radio-row { display: flex; flex-wrap: wrap; gap: 12px; }
.radio-label, .checkbox-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
  accent-color: var(--cream); width: 16px; height: 16px; cursor: pointer;
}
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 480px) {
  .checkbox-grid { grid-template-columns: repeat(3, 1fr); }
}
.conditional-fields { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ── Pond Profile Summary Card ────────────────────────────── */
.pond-profile-card { opacity: 0.85; }
.profile-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.profile-card-title {
  font-size: 12px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
}
.profile-card-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 768px) {
  .profile-card-grid { grid-template-columns: 1fr 1fr; }
}
.profile-card-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; line-height: 1.4;
}
.profile-card-icon { flex-shrink: 0; width: 20px; text-align: center; font-size: 14px; }
.profile-card-label {
  flex-shrink: 0; width: 60px; color: var(--text-dim); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.profile-card-value { color: var(--text); flex: 1; }

/* Secchi depth unit selector */
.wq-secchi-unit-select {
  width: auto; min-width: 56px; padding: 4px 6px; font-size: 12px;
  background: var(--bg-surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; margin-left: 4px; flex-shrink: 0;
}
.wq-secchi-ftin-wrap {
  display: flex; gap: 6px; align-items: center; margin-top: 6px;
}

/* Profile contact fields */
.profile-editable-row { flex-direction: column; align-items: stretch; gap: 4px; }
.profile-editable-row label { font-size: 12px; color: var(--text-muted); }
.profile-contact-input { font-size: 14px; padding: 8px 10px; }

/* Profile editor overlay — display flex immediately (no .active needed) */
.profile-editor-overlay { display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) {
  .profile-editor-overlay { align-items: center; }
}

/* Light mode overrides for profile */
html.light-mode .profile-section { background: #f5f3ed; border-color: var(--border); }
html.light-mode .profile-section-title { color: #141b45; }
html.light-mode .profile-card-title { color: #666; }
html.light-mode .radio-label input[type="radio"],
html.light-mode .checkbox-label input[type="checkbox"] { accent-color: #141b45; }

/* Theme toggle icon transition */
.theme-toggle-icon { transition: transform 0.3s ease; }
html.light-mode .theme-toggle-icon { transform: rotate(180deg); }

/* ── Treatment Enhancements ──────────────────────────────── */

/* Category badges */
.tx-category-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.tx-cat-chemical { background: rgba(220, 80, 60, 0.2); color: #e87060; }
.tx-cat-biological { background: rgba(60, 160, 80, 0.2); color: #5cba6c; }
.tx-cat-mechanical { background: rgba(100, 140, 200, 0.2); color: #7eb0e0; }
.tx-cat-aeration_adjustment { background: rgba(140, 180, 220, 0.2); color: #90c0e0; }
.tx-cat-dye { background: rgba(120, 80, 200, 0.2); color: #a08ce0; }
.tx-cat-liming { background: rgba(200, 180, 140, 0.2); color: #c8b88c; }
.tx-cat-other { background: rgba(140, 140, 140, 0.2); color: #aaa; }

/* Target condition tags */
.tx-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.tx-condition-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(242, 229, 179, 0.1);
  color: var(--text-dim);
  border: 1px solid rgba(242, 229, 179, 0.15);
}

/* Conditions grid in form */
.tx-conditions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.tx-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  padding: 2px 0;
}
.tx-checkbox-label input[type="checkbox"] {
  accent-color: var(--green);
}

/* Dosage calculation panel */
.tx-dosage-panel {
  background: rgba(28, 66, 32, 0.2);
  border: 1px solid rgba(28, 66, 32, 0.4);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.tx-dosage-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

/* Reorder link */
.tx-reorder-link {
  font-size: 11px;
  color: #7eb0e0;
  text-decoration: none;
}
.tx-reorder-link:hover {
  text-decoration: underline;
  color: #a0d0ff;
}

/* Effectiveness rating display */
.tx-effectiveness {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.tx-eff-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-dim);
}
.tx-stars {
  font-size: 14px;
  color: #e8c840;
  letter-spacing: 1px;
}

/* Rating prompt */
.tx-rate-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(232, 200, 64, 0.08);
  border: 1px solid rgba(232, 200, 64, 0.2);
  border-radius: 6px;
}
.tx-rate-question {
  font-size: 12px;
  color: var(--cream);
}
.tx-rate-stars {
  display: flex;
  gap: 2px;
}
.tx-star-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #e8c840;
  cursor: pointer;
  padding: 0 1px;
  transition: transform 0.1s;
}
.tx-star-btn:hover {
  transform: scale(1.2);
}

/* Photo upload placeholder */
.tx-photo-placeholder {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

/* Light mode overrides for treatments */
html.light-mode .tx-condition-tag {
  background: rgba(20, 27, 69, 0.06);
  border-color: rgba(20, 27, 69, 0.12);
  color: #555;
}
html.light-mode .tx-dosage-panel {
  background: rgba(28, 66, 32, 0.06);
  border-color: rgba(28, 66, 32, 0.15);
}
html.light-mode .tx-reorder-link { color: #2868a0; }
html.light-mode .tx-reorder-link:hover { color: #1a4870; }
html.light-mode .tx-rate-prompt {
  background: rgba(200, 170, 40, 0.06);
  border-color: rgba(200, 170, 40, 0.15);
}
html.light-mode .tx-rate-question { color: #333; }
html.light-mode .tx-photo-placeholder {
  border-color: #d8d5cc;
  background: rgba(0, 0, 0, 0.02);
}

/* ── Fix 1: Overview two-column grid on desktop ── */
@media (min-width: 768px) {
  .summary-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
  }
  .summary-grid-2col .summary-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
  }
  .summary-grid-2col .summary-item-label {
    display: inline;
    padding: 0;
    border-bottom: none;
    font-size: 14px;
  }
  .summary-grid-2col .summary-item-value {
    display: inline;
    padding: 0;
    border-bottom: none;
    font-size: 14px;
  }
}

/* ── Fix 2: Center bathymetry contour card on Depth tab ── */
.contour-map-section {
  margin-left: auto;
  margin-right: auto;
}

/* ── Fix 4: Recommended maintenance treatment cards ── */
.rec-treatments-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.rec-treatments-section h3 {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.rec-card {
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.rec-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 4px;
}
.rec-card-dose {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.rec-card-freq {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.rec-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rec-card-actions .btn-small {
  font-size: 11px;
  padding: 4px 10px;
}
.rec-card-shop {
  font-size: 11px;
  color: var(--cream-muted);
  text-decoration: none;
}
.rec-card-shop:hover {
  color: var(--cream);
}
@media (min-width: 768px) {
  .rec-treatments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .rec-card { margin-bottom: 0; }
}

/* ── Fix 6: Water test order button ── */
.wq-header-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Light mode overrides for new components */
html.light-mode .rec-card {
  background: #f8f7f3;
  border-color: #e0ddd5;
}
html.light-mode .rec-card-name { color: var(--navy); }
html.light-mode .rec-card-shop { color: #2868a0; }
html.light-mode .rec-card-shop:hover { color: #1a4870; }

/* ── Weather Card ──────────────────────────────────────── */
.weather-current {
  padding: 12px 0 8px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}
.weather-temp-row {
  display: flex; align-items: center; gap: 8px;
  justify-content: center;
}
.weather-icon {
  font-size: 28px; line-height: 1;
}
.weather-temp {
  font-size: 24px; font-weight: 700; color: var(--cream);
}
.weather-condition {
  font-size: 14px; color: var(--text-muted); margin-left: 4px;
}
.weather-details {
  display: flex; flex-direction: column; align-items: center; gap: 2px; margin-top: 6px;
  font-size: 12px; color: var(--text-dim);
}
.weather-meta {
  font-size: 11px; color: var(--text-dim); margin-top: 4px; opacity: 0.7;
  text-align: center;
}

/* 7-day forecast strip */
.weather-forecast {
  display: flex; gap: 4px; margin-top: 10px; max-width: 700px;
  margin-left: auto; margin-right: auto;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; padding-bottom: 2px;
  justify-content: center;
}
.weather-forecast::-webkit-scrollbar { display: none; }
.weather-forecast-day {
  flex: 1 0 auto; min-width: 72px; max-width: 96px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 4px; border-radius: 8px;
  background: rgba(255,255,255,0.04); font-size: 11px;
  text-align: center; cursor: pointer;
}
.forecast-day-name {
  font-weight: 600; color: var(--text-muted); font-size: 11px;
}
.forecast-icon { font-size: 18px; line-height: 1; }
.forecast-temps { color: var(--text); font-size: 12px; }
.forecast-temps b { color: var(--cream); }
.forecast-rain { color: #5dade2; font-size: 10px; }
.forecast-wind { color: var(--text-dim); font-size: 10px; }
.forecast-gusts { color: var(--text-dim); font-size: 9px; }

/* Light mode */
html.light-mode .weather-temp { color: var(--navy); }
html.light-mode .weather-condition { color: #555; }
html.light-mode .weather-details { color: #666; }
html.light-mode .weather-meta { color: #888; }
html.light-mode .weather-forecast-day { background: rgba(0,0,0,0.03); }
html.light-mode .forecast-day-name { color: #555; }
html.light-mode .forecast-temps { color: #333; }
html.light-mode .forecast-temps b { color: var(--navy); }

/* Desktop: forecast as grid */
@media (min-width: 600px) {
  .weather-forecast { gap: 4px; }
  .weather-forecast-day { min-width: 60px; }
}

/* ── Contextual Help Tooltips ── */
.help-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 4px;
  font-size: 10px; font-style: normal; font-weight: 700;
  line-height: 1; vertical-align: middle;
  color: var(--text-dim); background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 50%; cursor: help;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  flex-shrink: 0;
}
.help-icon:hover,
.help-icon-active {
  color: var(--cream); background: rgba(242,229,179,0.12);
  border-color: rgba(242,229,179,0.30);
}

.help-tooltip {
  position: absolute; z-index: 10000;
  max-width: 280px; padding: 10px 12px;
  font-size: 12.5px; line-height: 1.55;
  color: var(--text); background: var(--bg-surface);
  border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.35);
  pointer-events: none; opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s, transform 0.15s;
}
.help-tooltip.visible {
  opacity: 1; pointer-events: auto;
  transform: translateY(0);
}

/* Arrow */
.help-tooltip::after {
  content: ''; position: absolute;
  width: 10px; height: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 1px;
  transform: rotate(45deg);
}
/* Arrow pointing down (tooltip above icon) */
.help-tooltip[data-arrow="bottom"]::after {
  bottom: -6px; left: 50%;
  margin-left: -5px;
  border-top: none; border-left: none;
}
/* Arrow pointing up (tooltip below icon) */
.help-tooltip[data-arrow="top"]::after {
  top: -6px; left: 50%;
  margin-left: -5px;
  border-bottom: none; border-right: none;
}

/* Light mode overrides */
html.light-mode .help-icon {
  color: #8a8fa8; background: rgba(0,0,0,0.04);
  border-color: rgba(0,0,0,0.10);
}
html.light-mode .help-icon:hover,
html.light-mode .help-icon-active {
  color: #141b45; background: rgba(20,27,69,0.08);
  border-color: rgba(20,27,69,0.25);
}
html.light-mode .help-tooltip {
  background: #fff; border-color: #ddd; color: #333;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}
html.light-mode .help-tooltip::after {
  background: #fff; border-color: #ddd;

/* ── Feedback System ── */

/* Floating feedback buttons — desktop */
.feedback-buttons-desktop {
  position: fixed; bottom: calc(var(--tab-height) + 16px + var(--safe-bottom));
  right: 16px; z-index: 400;
  display: flex; flex-direction: column; gap: 8px;
}
.feedback-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--bg-card); color: var(--text);
  font-family: inherit; font-size: 12px; font-weight: 600;
  cursor: pointer; transition: transform 0.1s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  white-space: nowrap;
}
.feedback-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.4); }
.feedback-btn-feature { border-color: rgba(218,165,32,0.4); }
.feedback-btn-feature:hover { background: rgba(218,165,32,0.1); }
.feedback-btn-bug { border-color: rgba(192,57,43,0.3); }
.feedback-btn-bug:hover { background: rgba(192,57,43,0.08); }
.feedback-btn-icon { font-size: 14px; line-height: 1; }
/* Hide desktop buttons on mobile, show FAB instead */
@media (max-width: 639px) {
  .feedback-buttons-desktop { display: none; }
}

/* Floating feedback FAB — mobile */
.feedback-fab {
  position: fixed; bottom: calc(var(--tab-height) + 16px + var(--safe-bottom));
  right: 12px; z-index: 400;
}
.feedback-fab-toggle {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--bg-card); border: 1.5px solid var(--border);
  color: var(--cream); font-size: 18px; font-weight: 700;
  cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
}
.feedback-fab-menu {
  position: absolute; bottom: 48px; right: 0;
  display: none; flex-direction: column; gap: 6px;
  padding: 8px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  min-width: 160px;
}
.feedback-fab-menu.active { display: flex; }
.feedback-fab-option {
  padding: 10px 12px; border: none; border-radius: 8px;
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; text-align: left; white-space: nowrap;
}
.feedback-fab-option:hover { background: rgba(255,255,255,0.06); }
/* Hide FAB on desktop */
@media (min-width: 640px) {
  .feedback-fab { display: none; }
}

/* Feedback modal extras */
.feedback-type-badge {
  display: inline-block; padding: 4px 10px; border-radius: 6px;
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px;
}
.feedback-type-feature_request { background: rgba(218,165,32,0.15); color: #daa520; }
.feedback-type-bug_report { background: rgba(192,57,43,0.15); color: #e74c3c; }
.feedback-screenshot-preview {
  position: relative; display: inline-block; margin-top: 8px;
}
.feedback-screenshot-preview img {
  max-width: 100%; max-height: 120px; border-radius: 8px;
  border: 1px solid var(--border);
}
.feedback-screenshot-remove {
  position: absolute; top: -6px; right: -6px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--danger); color: #fff; border: none;
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.feedback-success {
  padding: 48px 24px; text-align: center;
}
.feedback-success-icon {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--success); color: #fff;
  font-size: 28px; font-weight: 700; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
}
.feedback-success h3 { color: var(--cream); font-size: 18px; margin-bottom: 8px; }
.feedback-success p { color: var(--text-muted); font-size: 14px; }

/* Feedback admin view */
.feedback-admin-content { padding: 12px 16px; overflow-y: auto; }
.feedback-admin-filters {
  display: flex; gap: 8px; margin-bottom: 12px;
}
.feedback-filter-select {
  flex: 1; padding: 8px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--bg-card);
  color: var(--text); font-family: inherit; font-size: 13px;
}
.feedback-admin-list { display: flex; flex-direction: column; gap: 10px; }
.feedback-admin-item {
  padding: 14px; border-radius: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.feedback-admin-item-header {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px;
}
.feedback-category-badge {
  padding: 2px 8px; border-radius: 4px; font-size: 11px;
  background: var(--bg-surface); color: var(--text-muted);
}
.feedback-status-badge {
  padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 700;
  text-transform: uppercase;
}
.feedback-status-new { background: rgba(52,152,219,0.15); color: #3498db; }
.feedback-status-reviewed { background: rgba(155,89,182,0.15); color: #9b59b6; }
.feedback-status-planned { background: rgba(230,126,34,0.15); color: #e67e22; }
.feedback-status-in_progress { background: rgba(241,196,15,0.15); color: #f1c40f; }
.feedback-status-completed { background: rgba(39,174,96,0.15); color: #27ae60; }
.feedback-status-declined { background: rgba(192,57,43,0.15); color: #c0392b; }
.feedback-vote-count {
  margin-left: auto; font-size: 12px; font-weight: 700;
  color: var(--cream-muted);
}
.feedback-admin-item-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.feedback-admin-item-desc {
  font-size: 13px; color: var(--text-muted); margin-bottom: 8px;
  white-space: pre-wrap; word-break: break-word;
}
.feedback-admin-item-meta {
  display: flex; gap: 12px; font-size: 12px; color: var(--text-dim); margin-bottom: 8px;
}
.feedback-admin-notes {
  padding: 8px 10px; border-radius: 6px; margin-bottom: 8px;
  background: rgba(242,229,179,0.06); border: 1px solid rgba(242,229,179,0.12);
  font-size: 12px; color: var(--text-muted);
}
.feedback-admin-actions {
  display: flex; gap: 8px; align-items: center;
}
.feedback-status-select {
  flex: 1; padding: 6px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--bg-surface);
  color: var(--text); font-family: inherit; font-size: 12px;
}

/* Feedback user items (profile) */
.feedback-user-item {
  padding: 12px; margin-bottom: 8px; border-radius: 8px;
  background: var(--bg-card); border: 1px solid var(--border);
}
.feedback-user-item-header {
  display: flex; gap: 6px; align-items: center; margin-bottom: 6px;
}
.feedback-user-item-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.feedback-user-item-desc {
  font-size: 12px; color: var(--text-muted); margin-bottom: 6px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.feedback-user-item-meta {
  display: flex; justify-content: space-between; font-size: 11px; color: var(--text-dim);

}

/* ============================================
   Light Mode Theme
   Toggle via html.light-mode class
   ============================================ */
html.light-mode {
  --bg: #faf8f2;
  --bg-card: #ffffff;
  --bg-surface: #f0ede6;
  --text: #000000;
  --text-muted: #1a1a1a;
  --text-dim: #3a3a3a;
  --border: #d8d5cc;
  --navy-dark: #f0ede6;
  --navy: #e8e4da;
  --navy-light: #ddd9d0;
  --danger: #c0392b;
  --success: #1e8e4e;
  --warning: #d4700a;
}

/* Light mode: header uses white with dark text */
html.light-mode .main-content { background: var(--bg); }
html.light-mode .login-screen { background: var(--bg); }
html.light-mode .app-header { background: #fff; border-bottom-color: #d8d5cc; }
html.light-mode .header-title { color: #141b45; }
html.light-mode .header-brand { color: #141b45; }
html.light-mode .header-brand .brand-by { color: #666; }
html.light-mode .theme-label { color: #333; }
html.light-mode .header-btn { color: #333; }
html.light-mode .tab-item { color: #444; }
html.light-mode .tab-item svg { stroke: #444; }
html.light-mode .detail-tab { color: #333; background: #f0f0f0; border-color: #ccc; }
html.light-mode .detail-tab:hover { color: #000; background: #e8e8e8; }
html.light-mode .pond-tab { color: #333; }
html.light-mode .pond-tab:hover { color: #000; }
html.light-mode .header-btn:hover { background: rgba(0,0,0,0.06); color: #000; }
html.light-mode .btn-secondary:hover { background: rgba(0,0,0,0.05); }
html.light-mode .tab-item:hover { background: rgba(0,0,0,0.04); }
html.light-mode .layer-toggle-row:hover { background: rgba(0,0,0,0.04); }

html.light-mode .soil-layer-row,
html.light-mode .soil-row,
html.light-mode .stream-item,
html.light-mode .horizon-detail-column .horizon-detail-row,
html.light-mode .horizon-detail-column .horizon-detail-annotation {
  border-bottom-color: rgba(0,0,0,0.06);
}

/* Cards get subtle shadow */
html.light-mode .pond-card,
html.light-mode .soil-card,
html.light-mode .soil-series-card,
html.light-mode .wq-reading-card,
html.light-mode .limitation-card,
html.light-mode .analysis-step {
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

html.light-mode .soil-weighted-card {
  border-color: #141b45;
  background: rgba(20,27,69,0.04);
}
html.light-mode .soil-card-area-badge {
  background: var(--bg-surface);
  color: #141b45;
}

html.light-mode .toast {
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

/* Map overlays stay dark (satellite backdrop) */
html.light-mode .edit-toolbar,
html.light-mode .map-layer-panel,
html.light-mode .map-back-btn {
  --bg: #0b0f24; --bg-card: #141b45; --bg-surface: #1a2350;
  --text: #f0ede4; --text-muted: #9a9bb0; --text-dim: #6b6d82;
  --border: #2a3060; --navy-dark: #0d1230; --navy: #141b45;
  --cream: #F2E5b3;
  color: #f0ede4;
}
html.light-mode .edit-toolbar { background: rgba(11,15,36,0.92); }
html.light-mode .map-layer-panel { background: rgba(11,15,36,0.88); }

html.light-mode .report-cta {
  background: rgba(28,66,32,0.06);
  border-color: rgba(28,66,32,0.18);
}

/* Primary button → navy with white text */
html.light-mode .btn-primary { background: #141b45; color: #fff; }
html.light-mode .btn-primary:hover { background: #0d1230; }

/* Back button and header breadcrumbs — navy instead of invisible cream */
html.light-mode .back-btn { color: #141b45; }
html.light-mode .back-btn:hover { color: #0d1230; }

/* WQ section headers → navy in light mode */
html.light-mode .wq-section-header { color: #141b45; }
html.light-mode .wq-section-header:not(.wq-section-header--static):hover { color: #0d1230; }

/* Accent text → navy instead of cream */
html.light-mode .header-title,
html.light-mode .welcome-title,
html.light-mode .view-header h2,
html.light-mode .pond-detail-name,
html.light-mode .summary-section h3,
html.light-mode .soil-series-name,
html.light-mode .soil-card-header strong,
html.light-mode .soil-section-title,
html.light-mode .soil-report-body h4.report-section-header,
html.light-mode .modal-header h2 {
  color: #141b45;
}

html.light-mode .tab-item.active { color: #141b45; }
html.light-mode .tab-item.active svg { stroke: #141b45; }
html.light-mode .pond-tab.active { color: #141b45; border-bottom-color: #141b45; }
html.light-mode .detail-tab.active { background: var(--green); border-color: var(--green-light); color: #fff; }
html.light-mode .stat-value { color: #141b45; }
html.light-mode .badge { background: var(--green); color: #fff; }
html.light-mode .profile-link { color: #141b45; }
html.light-mode .profile-link:hover { color: #0d1230; }

/* Loading screen stays dark */
html.light-mode .loading-screen { background: #0b0f24; color: #f0ede4; }

/* Form inputs */
html.light-mode .form-input,
html.light-mode .form-textarea,
html.light-mode .form-select,
html.light-mode .pond-select,
html.light-mode .batch-import-area { background: #fff; border-color: var(--border); }
html.light-mode .form-input:focus,
html.light-mode .form-textarea:focus,
html.light-mode .form-select:focus,
html.light-mode .batch-import-area:focus { border-color: #141b45; }

html.light-mode .progress-step.active span { background: #141b45; color: #fff; border-color: #141b45; }
html.light-mode .analysis-spinner { border-top-color: #141b45; }
html.light-mode .loading-spinner { border-top-color: #141b45; }
html.light-mode .map-fab { background: #141b45; color: #fff; }
html.light-mode .map-fab:hover { background: #0d1230; }
html.light-mode .depth-mode-btn.active,
html.light-mode .depth-tab.active { border-color: #141b45; color: #141b45; background: rgba(20,27,69,0.08); }
html.light-mode .wizard-map-instructions strong { color: #141b45; }
html.light-mode .soil-report-body h4.report-section-header { border-top-color: rgba(0,0,0,0.05); }

/* ── Pond Profile Form ────────────────────────────────────── */
.profile-form-sections { display: flex; flex-direction: column; gap: 16px; }
.profile-section {
  padding: 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-surface);
}
.profile-section-title {
  font-size: 12px; font-weight: 600; color: var(--cream-muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px;
}
.radio-row { display: flex; flex-wrap: wrap; gap: 12px; }
.radio-label, .checkbox-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text); cursor: pointer;
}
.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
  accent-color: var(--cream); width: 16px; height: 16px; cursor: pointer;
}
.checkbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 480px) {
  .checkbox-grid { grid-template-columns: repeat(3, 1fr); }
}
.conditional-fields { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

/* ── Pond Profile Summary Card ────────────────────────────── */
.pond-profile-card { opacity: 0.85; }
.profile-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px;
}
.profile-card-title {
  font-size: 12px; color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.5px; font-weight: 600;
}
.profile-card-grid { display: grid; grid-template-columns: 1fr; gap: 6px; }
@media (min-width: 768px) {
  .profile-card-grid { grid-template-columns: 1fr 1fr; }
}
.profile-card-row {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 13px; line-height: 1.4;
}
.profile-card-icon { flex-shrink: 0; width: 20px; text-align: center; font-size: 14px; }
.profile-card-label {
  flex-shrink: 0; width: 60px; color: var(--text-dim); font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.3px;
}
.profile-card-value { color: var(--text); flex: 1; }

/* Secchi depth unit selector */
.wq-secchi-unit-select {
  width: auto; min-width: 56px; padding: 4px 6px; font-size: 12px;
  background: var(--bg-surface); color: var(--text); border: 1px solid var(--border);
  border-radius: 6px; margin-left: 4px; flex-shrink: 0;
}
.wq-secchi-ftin-wrap {
  display: flex; gap: 6px; align-items: center; margin-top: 6px;
}

/* Profile contact fields */
.profile-editable-row { flex-direction: column; align-items: stretch; gap: 4px; }
.profile-editable-row label { font-size: 12px; color: var(--text-muted); }
.profile-contact-input { font-size: 14px; padding: 8px 10px; }

/* Profile editor overlay — display flex immediately (no .active needed) */
.profile-editor-overlay { display: flex; align-items: flex-end; justify-content: center; }
@media (min-width: 640px) {
  .profile-editor-overlay { align-items: center; }
}

/* Light mode overrides for profile */
html.light-mode .profile-section { background: #f5f3ed; border-color: var(--border); }
html.light-mode .profile-section-title { color: #141b45; }
html.light-mode .profile-card-title { color: #666; }
html.light-mode .radio-label input[type="radio"],
html.light-mode .checkbox-label input[type="checkbox"] { accent-color: #141b45; }
/* Light mode — feedback overrides */
html.light-mode .feedback-btn { background: #fff; border-color: #d8d5cc; color: #1a1a1a; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
html.light-mode .feedback-btn:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
html.light-mode .feedback-btn-feature { border-color: rgba(184,134,11,0.4); }
html.light-mode .feedback-btn-bug { border-color: rgba(192,57,43,0.3); }
html.light-mode .feedback-fab-toggle { background: #141b45; color: #fff; border-color: #141b45; }
html.light-mode .feedback-fab-menu { background: #fff; border-color: #d8d5cc; }
html.light-mode .feedback-fab-option { color: #1a1a1a; }
html.light-mode .feedback-fab-option:hover { background: rgba(0,0,0,0.04); }
html.light-mode .feedback-admin-item,
html.light-mode .feedback-user-item { background: #fff; border-color: #d8d5cc; }
html.light-mode .feedback-type-feature_request { background: rgba(184,134,11,0.12); color: #8b6914; }
html.light-mode .feedback-type-bug_report { background: rgba(192,57,43,0.12); color: #c0392b; }
html.light-mode .feedback-admin-notes { background: rgba(20,27,69,0.04); border-color: rgba(20,27,69,0.08); }
html.light-mode .feedback-success h3 { color: #141b45; }
html.light-mode .feedback-filter-select,
html.light-mode .feedback-status-select { background: #fff; border-color: #d8d5cc; color: #1a1a1a; }


/* Theme toggle icon transition */
.theme-toggle-icon { transition: transform 0.3s ease; }
html.light-mode .theme-toggle-icon { transform: rotate(180deg); }

/* ── Treatment Enhancements ──────────────────────────────── */

/* Category badges */
.tx-category-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.tx-cat-chemical { background: rgba(220, 80, 60, 0.2); color: #e87060; }
.tx-cat-biological { background: rgba(60, 160, 80, 0.2); color: #5cba6c; }
.tx-cat-mechanical { background: rgba(100, 140, 200, 0.2); color: #7eb0e0; }
.tx-cat-aeration_adjustment { background: rgba(140, 180, 220, 0.2); color: #90c0e0; }
.tx-cat-dye { background: rgba(120, 80, 200, 0.2); color: #a08ce0; }
.tx-cat-liming { background: rgba(200, 180, 140, 0.2); color: #c8b88c; }
.tx-cat-other { background: rgba(140, 140, 140, 0.2); color: #aaa; }

/* Target condition tags */
.tx-conditions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}
.tx-condition-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  background: rgba(242, 229, 179, 0.1);
  color: var(--text-dim);
  border: 1px solid rgba(242, 229, 179, 0.15);
}

/* Conditions grid in form */
.tx-conditions-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
}
.tx-checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  padding: 2px 0;
}
.tx-checkbox-label input[type="checkbox"] {
  accent-color: var(--green);
}

/* Dosage calculation panel */
.tx-dosage-panel {
  background: rgba(28, 66, 32, 0.2);
  border: 1px solid rgba(28, 66, 32, 0.4);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.tx-dosage-title {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

/* Reorder link */
.tx-reorder-link {
  font-size: 11px;
  color: #7eb0e0;
  text-decoration: none;
}
.tx-reorder-link:hover {
  text-decoration: underline;
  color: #a0d0ff;
}

/* Effectiveness rating display */
.tx-effectiveness {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}
.tx-eff-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  color: var(--text-dim);
}
.tx-stars {
  font-size: 14px;
  color: #e8c840;
  letter-spacing: 1px;
}

/* Rating prompt */
.tx-rate-prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 6px 10px;
  background: rgba(232, 200, 64, 0.08);
  border: 1px solid rgba(232, 200, 64, 0.2);
  border-radius: 6px;
}
.tx-rate-question {
  font-size: 12px;
  color: var(--cream);
}
.tx-rate-stars {
  display: flex;
  gap: 2px;
}
.tx-star-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #e8c840;
  cursor: pointer;
  padding: 0 1px;
  transition: transform 0.1s;
}
.tx-star-btn:hover {
  transform: scale(1.2);
}

/* Photo upload placeholder */
.tx-photo-placeholder {
  border: 1px dashed var(--border);
  border-radius: 6px;
  padding: 16px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
}

/* Light mode overrides for treatments */
html.light-mode .tx-condition-tag {
  background: rgba(20, 27, 69, 0.06);
  border-color: rgba(20, 27, 69, 0.12);
  color: #555;
}
html.light-mode .tx-dosage-panel {
  background: rgba(28, 66, 32, 0.06);
  border-color: rgba(28, 66, 32, 0.15);
}
html.light-mode .tx-reorder-link { color: #2868a0; }
html.light-mode .tx-reorder-link:hover { color: #1a4870; }
html.light-mode .tx-rate-prompt {
  background: rgba(200, 170, 40, 0.06);
  border-color: rgba(200, 170, 40, 0.15);
}
html.light-mode .tx-rate-question { color: #333; }
html.light-mode .tx-photo-placeholder {
  border-color: #d8d5cc;
  background: rgba(0, 0, 0, 0.02);
}

/* ── Fix 1: Overview two-column grid on desktop ── */
@media (min-width: 768px) {
  .summary-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    width: 100%;
  }
  .summary-grid-2col .summary-item {
    display: flex;
    align-items: baseline;
    gap: 12px;
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
  }
  .summary-grid-2col .summary-item-label {
    display: inline;
    padding: 0;
    border-bottom: none;
    font-size: 14px;
  }
  .summary-grid-2col .summary-item-value {
    display: inline;
    padding: 0;
    border-bottom: none;
    font-size: 14px;
  }
}

/* ── Fix 2: Center bathymetry contour card on Depth tab ── */
.contour-map-section {
  margin-left: auto;
  margin-right: auto;
  max-width: 640px;
}

/* ── Fix 4: Recommended maintenance treatment cards ── */
.rec-treatments-section {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.rec-treatments-section h3 {
  font-size: 13px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}
.rec-card {
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.rec-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 4px;
}
.rec-card-dose {
  font-size: 13px;
  color: var(--text);
  margin-bottom: 2px;
}
.rec-card-freq {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.rec-card-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.rec-card-actions .btn-small {
  font-size: 11px;
  padding: 4px 10px;
}
.rec-card-shop {
  font-size: 11px;
  color: var(--cream-muted);
  text-decoration: none;
}
.rec-card-shop:hover {
  color: var(--cream);
}
@media (min-width: 768px) {
  .rec-treatments-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .rec-card { margin-bottom: 0; }
}

/* ── Fix 6: Water test order button ── */
.wq-header-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Light mode overrides for new components */
html.light-mode .rec-card {
  background: #f8f7f3;
  border-color: #e0ddd5;
}
html.light-mode .rec-card-name { color: var(--navy); }
html.light-mode .rec-card-shop { color: #2868a0; }
html.light-mode .rec-card-shop:hover { color: #1a4870; }

/* ── Photo Log ──────────────────────────────────────────────── */

.photo-view-toggle {
  display: flex;
  gap: 4px;
}

.photo-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 0 0 16px;
}
@media (max-width: 600px) {
  .photo-gallery-grid { grid-template-columns: repeat(2, 1fr); }
}

.photo-gallery-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 6px;
  cursor: pointer;
  background: var(--bg-surface);
}
.photo-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.photo-gallery-item:hover img { transform: scale(1.05); }

.photo-gallery-pond-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 6px;
  font-size: 10px;
  color: #fff;
  background: rgba(0,0,0,0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Category badges */
.photo-category-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.photo-cat-shoreline      { background: #1a5276; color: #aed6f1; }
.photo-cat-water_clarity   { background: #0e6251; color: #a3e4d7; }
.photo-cat-algae_weed      { background: #145a32; color: #82e0aa; }
.photo-cat-vegetation      { background: #1c4220; color: #a9dfbf; }
.photo-cat-wildlife        { background: #6c3483; color: #d7bde2; }
.photo-cat-equipment       { background: #784212; color: #f0d9b5; }
.photo-cat-before_after    { background: #7b241c; color: #f5b7b1; }
.photo-cat-general         { background: var(--bg-surface); color: var(--text-muted); }

/* Timeline display */
.photo-timeline-date {
  font-size: 12px;
  font-weight: 700;
  color: var(--cream);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.photo-card {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  position: relative;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.photo-card:last-child { border-bottom: none; }
.photo-card:hover { background: var(--bg-surface); border-radius: 8px; padding-left: 8px; margin-left: -8px; }

.photo-card-img {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-surface);
}
.photo-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-card-info {
  flex: 1;
  min-width: 0;
  position: relative;
}

.photo-card-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}

.photo-card-time {
  font-size: 12px;
  color: var(--text-dim);
}

.photo-card-desc {
  font-size: 13px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Lightbox overlay */
.photo-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-caption {
  text-align: center;
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
}

.lightbox-counter {
  color: rgba(255,255,255,0.5);
  font-size: 12px;
}

.lightbox-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  z-index: 2;
  line-height: 1;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #fff;
  font-size: 48px;
  cursor: pointer;
  padding: 16px;
  z-index: 2;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.lightbox-nav:hover { opacity: 1; }
.lightbox-prev { left: 8px; }
.lightbox-next { right: 8px; }

/* Light mode overrides for photos */
html.light-mode .photo-timeline-date { color: var(--navy); }
html.light-mode .photo-card:hover { background: #f3f0e8; }
html.light-mode .photo-cat-general { background: #e8e5dc; color: #555; }

/* ── Watershed Stats ──────────────────────────────────────── */
.ws-stats { margin-bottom: 0; }

/* Watershed tab uses full width — override the max-width constraint from .pond-detail-section */
.pond-detail-section:has(.ws-stats) {
  max-width: none;
}

/* ── Treatments Weather (self-contained) ── */
.tx-wx-section {
  margin-top: 24px;
  padding: 16px;
  border: 1px solid var(--border, #2a3060);
  border-radius: 10px;
  background: rgba(255,255,255,0.02);
}
.tx-wx-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--cream, #F2E5b3);
  margin-bottom: 12px;
}
.tx-wx-current {
  margin-bottom: 12px;
}
.tx-wx-wind-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text, #f0ede4);
}
.tx-wx-wind-gusts {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-dim, #9a9bb0);
}
.tx-wx-conditions {
  font-size: 12px;
  color: var(--text-dim, #9a9bb0);
  margin-top: 4px;
}
.tx-wx-forecast {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.tx-wx-day {
  display: grid;
  grid-template-columns: 3.5rem 1.5rem 4rem 5rem 3rem 3rem;
  gap: 4px;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  font-size: 12px;
}
.tx-wx-day:last-child { border-bottom: none; }
.tx-wx-day-name { font-weight: 600; color: var(--text-muted, #b0b1c4); }
.tx-wx-day-icon { font-size: 16px; text-align: center; }
.tx-wx-day-temps { color: var(--text, #f0ede4); }
.tx-wx-day-wind { color: var(--text-dim, #9a9bb0); white-space: nowrap; }
.tx-wx-day-gusts { color: var(--text-dim, #9a9bb0); }
.tx-wx-day-rain { color: #5dade2; }

/* Light mode */
html.light-mode .tx-wx-section { background: rgba(0,0,0,0.02); border-color: #e0ddd5; }
html.light-mode .tx-wx-title { color: var(--navy, #141b45); }
html.light-mode .tx-wx-wind-primary { color: #333; }

/* Mobile: narrower grid */
@media (max-width: 480px) {
  .tx-wx-day {
    grid-template-columns: 3rem 1.3rem 3.5rem 4.5rem 2.5rem 2.5rem;
    font-size: 11px;
  }
}

/* ── Watershed two-column layout ── */
.ws-two-col-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 24px;
}
.ws-two-col-inline > div {
  align-self: start;
}
@media (max-width: 767px) {
  .ws-two-col-inline { display: flex !important; flex-direction: column !important; }
}

/* ── Hourly weather popup ── */
.wx-hourly-popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 600; display: flex; align-items: center; justify-content: center; }
.wx-hourly-popup { background: var(--bg-card, #141b45); border: 1px solid var(--border, #2a3060); border-radius: 12px; padding: 16px; max-width: 360px; width: 90%; max-height: 80vh; overflow-y: auto; position: relative; }
.wx-hourly-popup h3 { font-size: 14px; color: var(--cream); margin-bottom: 12px; }
.wx-hourly-popup table { width: 100%; border-collapse: collapse; font-size: 12px; }
.wx-hourly-popup th { text-align: left; padding: 4px 8px; border-bottom: 1px solid rgba(255,255,255,0.1); color: var(--text-muted); font-size: 11px; }
.wx-hourly-popup td { padding: 4px 8px; color: var(--text); }
.wx-hourly-popup-close { position: absolute; top: 8px; right: 12px; background: none; border: none; color: var(--text-muted); font-size: 18px; cursor: pointer; }
html.light-mode .wx-hourly-popup { background: #fff; border-color: #d8d5cc; }

/* ── Best Treatment Windows ── */
.tx-best-windows { margin-bottom: 16px; }
.tx-best-windows-title { font-size: 15px; font-weight: 700; color: var(--cream); margin-bottom: 4px; }
.tx-best-windows-subtitle { font-size: 11px; color: var(--text-dim); margin-bottom: 8px; }
.tx-windows-strip { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; margin-bottom: 16px; }
.tx-windows-strip::-webkit-scrollbar { display: none; }
.tx-win-card { flex: 0 0 auto; min-width: 140px; max-width: 180px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--border); background: rgba(255,255,255,0.03); text-align: center; font-size: 11px; }
.tx-win-card.tx-win-excellent { border-color: rgba(46,204,113,0.4); background: rgba(46,204,113,0.06); }
.tx-win-card.tx-win-good { border-color: rgba(241,196,15,0.4); background: rgba(241,196,15,0.06); }
.tx-win-card.tx-win-fair { border-color: rgba(149,165,166,0.3); background: rgba(149,165,166,0.04); }
.tx-win-day { font-weight: 700; font-size: 12px; color: var(--cream); }
.tx-win-time { font-size: 11px; color: var(--text); margin-top: 2px; }
.tx-win-detail { font-size: 10px; color: var(--text-dim); margin-top: 3px; }
.tx-win-badge { display: inline-block; font-size: 9px; padding: 1px 5px; border-radius: 3px; margin-top: 4px; }
.tx-win-badge-excellent { background: rgba(46,204,113,0.2); color: #2ecc71; }
.tx-win-badge-good { background: rgba(241,196,15,0.2); color: #f1c40f; }
.tx-win-badge-fair { background: rgba(149,165,166,0.2); color: #95a5a6; }
.tx-best-windows-none { font-size: 12px; color: var(--text-dim); padding: 12px; background: rgba(255,255,255,0.03); border-radius: 8px; border: 1px solid var(--border); text-align: center; }
html.light-mode .tx-best-windows-title { color: var(--navy, #141b45); }
html.light-mode .tx-win-card { background: rgba(0,0,0,0.02); }

/* Fish Tracker Teaser */
.ft-teaser { padding: 16px; max-width: 800px; margin: 0 auto; }
.ft-hero { text-align: center; padding: 24px 16px; }
.ft-hero-icon { font-size: 48px; margin-bottom: 8px; }
.ft-hero-title { font-size: 22px; font-weight: 700; color: var(--cream, #F2E5b3); margin-bottom: 4px; }
.ft-hero-subtitle { font-size: 13px; color: var(--text-dim, #9a9bb0); margin-bottom: 12px; }
.ft-hero-desc { font-size: 13px; color: var(--text, #f0ede4); max-width: 500px; margin: 0 auto; line-height: 1.5; }
.ft-badge-coming-soon { text-align: center; margin: 16px 0; }
.ft-badge-coming-soon span { display: inline-block; padding: 6px 16px; border-radius: 20px; background: rgba(241,196,15,0.12); color: #f1c40f; font-size: 12px; font-weight: 600; }
.ft-features { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0; }
@media (max-width: 480px) { .ft-features { grid-template-columns: 1fr; } }
.ft-feature-card { padding: 14px; border: 1px solid var(--border, #2a3060); border-radius: 8px; background: rgba(255,255,255,0.02); }
.ft-feature-icon { font-size: 24px; margin-bottom: 6px; }
.ft-feature-card h3 { font-size: 13px; font-weight: 700; color: var(--cream, #F2E5b3); margin-bottom: 4px; }
.ft-feature-card p { font-size: 11px; color: var(--text-dim, #9a9bb0); line-height: 1.4; }
.ft-preview { margin: 24px 0; }
.ft-preview-title { font-size: 15px; font-weight: 700; color: var(--cream, #F2E5b3); margin-bottom: 12px; }
.ft-sample-stats { display: flex; gap: 16px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.ft-stat { text-align: center; min-width: 70px; }
.ft-stat-value { font-size: 22px; font-weight: 700; color: var(--cream, #F2E5b3); }
.ft-stat-label { font-size: 10px; color: var(--text-dim, #9a9bb0); text-transform: uppercase; letter-spacing: 0.5px; }
.ft-sample-table { margin: 16px 0; }
.ft-sample-table h4 { font-size: 12px; color: var(--text-muted, #b0b1c4); text-transform: uppercase; margin-bottom: 8px; }
.ft-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.ft-table th { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--border, #2a3060); color: var(--text-muted, #b0b1c4); font-size: 11px; }
.ft-table td { padding: 6px 8px; border-bottom: 1px solid rgba(255,255,255,0.03); color: var(--text, #f0ede4); }
.ft-sample-tags { margin: 20px 0; }
.ft-sample-tags h4 { font-size: 12px; color: var(--text-muted, #b0b1c4); text-transform: uppercase; margin-bottom: 8px; }
.ft-tag-cards { display: flex; flex-direction: column; gap: 8px; }
.ft-tag-card { padding: 10px 14px; border: 1px solid var(--border, #2a3060); border-radius: 8px; background: rgba(255,255,255,0.02); }
.ft-tag-id { font-size: 12px; font-weight: 700; color: #F2E5b3; }
.ft-tag-species { font-size: 13px; color: var(--text, #f0ede4); margin-top: 2px; }
.ft-tag-detail { font-size: 11px; color: var(--text-dim, #9a9bb0); margin-top: 2px; }
.ft-cta { text-align: center; padding: 24px 16px; margin-top: 20px; border-top: 1px solid var(--border, #2a3060); }
.ft-cta-text { font-size: 13px; color: var(--text-dim, #9a9bb0); margin-bottom: 12px; }
.ft-cta-btn { padding: 10px 24px; border-radius: 8px; background: rgba(241,196,15,0.15); color: #f1c40f; border: 1px solid rgba(241,196,15,0.3); font-size: 13px; font-weight: 600; cursor: not-allowed; opacity: 0.7; }
.ft-cta-note { font-size: 11px; color: var(--text-dim); margin-top: 8px; }
/* Light mode */
html.light-mode .ft-hero-title { color: var(--navy); }
html.light-mode .ft-stat-value { color: var(--navy); }
html.light-mode .ft-feature-card { background: rgba(0,0,0,0.02); border-color: #e0ddd5; }
html.light-mode .ft-tag-card { background: rgba(0,0,0,0.02); border-color: #e0ddd5; }
html.light-mode .ft-table td { color: #333; }
