/* ========================================
   MODERN DESIGN SYSTEM FOR RENEWABLE ENERGY CALCULATOR
   Created with Vanilla CSS - Professional Edition
   ======================================== */

/* ========================================
   DESIGN TOKENS & CSS VARIABLES
   ======================================== */
:root {
  /* Colors - Professional Green Energy Theme */
  --color-primary: #2E7D32;
  --color-primary-hover: #1B5E20;
  --color-primary-light: #4CAF50;
  --color-secondary: #0288D1;
  --color-accent: #FFA726;
  --color-success: #4CAF50;
  --color-danger: #D32F2F;
  --color-warning: #FFA000;
  
  /* Energy Type Colors */
  --color-solar-start: #FFA726;
  --color-solar-end: #FF6F00;
  --color-wind-start: #42A5F5;
  --color-wind-end: #1976D2;
  --color-geo-start: #EF5350;
  --color-geo-end: #D32F2F;
  
  /* Neutrals */
  --color-bg-primary: #FFFFFF;
  --color-bg-secondary: #F5F5F5;
  --color-bg-tertiary: #FAFAFA;
  --color-border: #E0E0E0;
  --color-border-hover: #BDBDBD;
  --color-text-primary: #212121;
  --color-text-secondary: #757575;
  --color-text-muted: #9E9E9E;
  
  /* Typography */
  --font-family-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-family-heading: 'Poppins', 'Inter', sans-serif;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-xl: 0 20px 25px rgba(0,0,0,0.15), 0 10px 10px rgba(0,0,0,0.04);
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 350ms ease;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

body, html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--font-family-primary);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
  display: flex;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.sidebar {
  flex: 0 0 clamp(300px, 30vw, 380px);
  width: clamp(300px, 30vw, 380px);
  padding: var(--space-lg);
  background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 2px 0 8px rgba(0,0,0,0.05);
}

.sidebar::-webkit-scrollbar {
  width: 8px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: var(--radius-full);
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: var(--color-border-hover);
}

#map {
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: hidden;
}

/* ========================================
   BRANDING
   ======================================== */
.brand-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #ffffff 0%, #f7fbf7 100%);
  box-shadow: var(--shadow-sm);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 253, 244, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 20px rgba(15, 23, 42, 0.06);
}

.brand-logo {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: #fff;
}

.brand-text {
  min-width: 0;
  flex: 1 1 220px;
}

.brand-title {
  font-family: var(--font-family-heading);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.12;
  color: var(--color-text-primary);
}

.brand-subtitle {
  font-size: 12px;
  color: var(--color-text-secondary);
}

.backend-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.backend-status:hover {
  box-shadow: var(--shadow-sm);
}

.backend-status-dot {
  font-size: 10px;
}

.backend-status.status-up {
  color: #1b5e20;
  border-color: #bfe5c3;
  background: #f1fbf2;
}

.backend-status.status-down {
  color: #8e1a1a;
  border-color: #f2c1c1;
  background: #fff3f3;
}

.backend-status.status-checking {
  color: #7a5a0a;
  border-color: #f3dc9d;
  background: #fff9e8;
}

/* ========================================
   PANELS
   ======================================== */
.panel {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-md);
  background: var(--color-bg-primary);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.panel:hover {
  box-shadow: var(--shadow-md);
}

.panel.hidden {
  display: none;
}

.panel .title {
  font-family: var(--font-family-heading);
  font-weight: 700;
  font-size: 24px;
  margin-bottom: var(--space-lg);
  color: var(--color-text-primary);
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.diligence-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 104px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}

.diligence-status-badge.assumed {
  background: #fff7ed;
  color: #9a3412;
  border-color: #fdba74;
}

.diligence-status-badge.documented {
  background: #ecfdf5;
  color: #166534;
  border-color: #86efac;
}

.diligence-status-badge.unresolved {
  background: #f8fafc;
  color: #475569;
  border-color: #cbd5e1;
}

/* ========================================
   PROGRESS STEPPER
   ======================================== */
.progress-indicator {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: center;
  margin-bottom: var(--space-xl);
  padding: var(--space-md);
  background: linear-gradient(135deg, rgba(46, 125, 50, 0.05) 0%, rgba(46, 125, 50, 0.02) 100%);
  border-radius: var(--radius-md);
  overflow-x: hidden;
}

.stepper-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  width: 100%;
  position: relative;
}

.stepper-circle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: 2px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  background: var(--color-bg-primary);
  transition: all var(--transition-base);
  z-index: 2;
}

.stepper-step.active .stepper-circle {
  border-color: #fdba74;
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  color: white;
  box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.18), 0 10px 22px rgba(234, 88, 12, 0.28);
  transform: scale(1.16);
}

.stepper-step.completed .stepper-circle {
  border-color: var(--color-success);
  background: var(--color-success);
  color: white;
}

.stepper-label {
  font-size: 11px;
  margin-top: var(--space-xs);
  color: var(--color-text-muted);
  font-weight: 500;
  text-align: center;
}

.stepper-step.active .stepper-label {
  color: #9a3412;
  font-weight: 900;
}

.stepper-line {
  position: absolute;
  top: 18px;
  left: calc(50% + 18px);
  right: auto;
  width: calc(100% - 36px);
  height: 2px;
  background: var(--color-border);
  z-index: 1;
}

.stepper-step:last-child .stepper-line {
  display: none;
}

.stepper-step.completed .stepper-line {
  background: var(--color-success);
}

/* ========================================
   TYPOGRAPHY
   ======================================== */
label {
  display: block;
  font-weight: 500;
  font-size: 14px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-xs);
}

.country-region {
  font-style: italic;
  font-size: 13px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: rgba(46, 125, 50, 0.05);
  border-left: 3px solid var(--color-primary);
  border-radius: var(--radius-sm);
}

/* ========================================
   KPI STRIP
   ======================================== */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-sm);
  margin: 0 0 var(--space-md);
}

.kpi-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #ffffff 0%, #f7fbf7 100%);
}

.kpi-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--color-text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 13px;
  color: var(--color-text-primary);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========================================
   FORM ELEMENTS
   ======================================== */
input, select {
  width: 100%;
  margin-bottom: var(--space-md);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-border);
  font-size: 15px;
  font-family: inherit;
  transition: all var(--transition-base);
  background: var(--color-bg-primary);
  color: var(--color-text-primary);
}

input:focus, select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

input:disabled {
  background: var(--color-bg-secondary);
  cursor: not-allowed;
  opacity: 0.7;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  opacity: 1;
}

/* ========================================
   BUTTONS
   ======================================== */
.big-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-hover) 100%);
  color: #fff;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: var(--space-sm);
  margin-right: var(--space-sm);
  min-width: 140px;
  box-shadow: 0 2px 4px rgba(46, 125, 50, 0.2);
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
  font-family: inherit;
}

.big-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.big-button:hover::before {
  left: 100%;
}

.big-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.big-button:active {
  transform: translateY(0);
}

.big-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.big-button.loading {
  pointer-events: none;
  color: transparent;
}

.big-button.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-left: -10px;
  margin-top: -10px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.red-button {
  background: linear-gradient(135deg, var(--color-danger) 0%, #C62828 100%) !important;
  box-shadow: 0 2px 4px rgba(211, 47, 47, 0.2) !important;
}

.red-button:hover {
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.3) !important;
}

button[style*="background-color: #777"] {
  background: var(--color-bg-secondary) !important;
  color: var(--color-text-primary) !important;
  box-shadow: none !important;
}

button[style*="background-color: #777"]:hover {
  background: var(--color-border) !important;
}

/* ========================================
   FINAL ACTION BAR
   ======================================== */
.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-top: var(--space-lg) !important;
  padding: var(--space-sm);
  border-top: 1px solid var(--color-border);
  background: linear-gradient(to top, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.88));
  backdrop-filter: blur(3px);
}

.sticky-actions .big-button {
  flex: 1;
  margin: 0;
}

/* ========================================
   CHECKBOXES
   ======================================== */
.checkbox-row {
  display: flex;
  align-items: center;
  margin: var(--space-md) 0;
  cursor: pointer;
}

.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  margin: 0;
  margin-right: var(--space-sm);
  cursor: pointer;
}

.checkbox-row label {
  margin: 0;
  font-weight: normal;
  cursor: pointer;
}

/* ========================================
   TOOLTIPS
   ======================================== */
.tooltip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: help;
  margin-left: var(--space-xs);
  transition: all var(--transition-fast);
  text-decoration: none;
}

.tooltip-icon:hover {
  transform: scale(1.15);
  background: var(--color-primary-hover);
}

/* ========================================
   INFO AREAS & DETAILS
   ======================================== */
.info-area {
  background: var(--color-bg-tertiary);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin-top: var(--space-md);
  display: none;
}

details {
  margin-top: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--color-bg-tertiary);
}

summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--color-primary);
  padding: var(--space-sm);
  margin: calc(-1 * var(--space-md));
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  transition: background var(--transition-fast);
}

summary:hover {
  background: rgba(46, 125, 50, 0.05);
}

details[open] summary {
  margin-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

/* ========================================
   SPINNER / LOADING
   ======================================== */
.spinner {
  display: none;
  position: fixed;
  right: 16px;
  bottom: 16px;
  top: auto;
  left: auto;
  max-width: min(320px, calc(100vw - 32px));
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(15, 23, 42, 0.92);
  padding: 12px 14px;
  border-radius: 14px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.24);
  z-index: 9999;
  line-height: 1.4;
  text-align: left;
  pointer-events: none;
  backdrop-filter: blur(3px);
}

.spinner.spinner-overlay {
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: none;
  padding: 0;
  border-radius: 0;
  text-align: center;
  font-size: 16px;
  color: var(--color-text-primary);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-circle {
  width: 60px;
  height: 60px;
  border: 4px solid var(--color-bg-secondary);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

.spinner-text {
  margin-top: var(--space-lg);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text-primary);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-width: 400px;
}

.toast {
  background: white;
  padding: 16px 24px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  white-space: pre-line;
  transform: translateX(calc(100% + 24px));
  transition: transform var(--transition-base);
  border-left: 4px solid var(--color-primary);
}

.toast.show {
  transform: translateX(0);
}

.toast.success {
  border-left-color: var(--color-success);
}

.toast.error {
  border-left-color: var(--color-danger);
}

.toast.warning {
  border-left-color: var(--color-warning);
}

.toast.info {
  border-left-color: var(--color-secondary);
}

/* ========================================
   ENERGY TYPE HEADERS
   ======================================== */
.energy-header {
  font-size: 2em;
  font-weight: bold;
  margin: var(--space-lg) 0;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.energy-header img {
  vertical-align: middle;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   METRICS & CARDS
   ======================================== */
.metric-card {
  background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  margin: var(--space-md) 0;
}

.metric-label {
  font-size: 13px;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-xs);
  font-weight: 500;
}

.metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.2;
}

/* ========================================
   MOBILE TOGGLE
   ======================================== */
#toggleSidebar {
  display: none;
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1100;
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

#toggleSidebar:hover {
  background: var(--color-primary-hover);
  transform: scale(1.05);
}

/* ========================================
   MAPBOX CUSTOMIZATION
   ======================================== */
.mapbox-gl-draw_ctrl-icon {
  width: 40px;
  height: 40px;
}

.mapbox-gl-draw_ctrl-draw-btn {
  background-size: 40px 40px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* At 601-768px: sidebar stays visible, menu button hidden */
@media (max-width: 768px) and (min-width: 601px) {
  #toggleSidebar { display: none !important; }
  .sidebar { display: block !important; }
}

@media (max-width: 768px) {
  .container {
    flex-direction: column;
  }

  .sidebar {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 90%;
    max-width: 400px;
    height: 100%;
    background: #fafafa;
    border-right: 1px solid var(--color-border);
    overflow-y: auto;
    z-index: 1000;
    padding: var(--space-lg);
    box-shadow: var(--shadow-xl);
  }

  #map {
    height: 100%;
  }

  #toggleSidebar {
    display: block;
  }

  .big-button {
    width: 100%;
    margin-right: 0;
    margin-bottom: var(--space-sm);
  }

  .panel .title {
    font-size: 20px;
  }

  .kpi-strip {
    grid-template-columns: 1fr;
  }

  .brand-header {
    padding: var(--space-sm) var(--space-md);
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .stepper-step {
    min-width: 50px;
  }

  .stepper-circle {
    width: 30px;
    height: 30px;
    font-size: 12px;
  }

  .stepper-label {
    font-size: 10px;
  }

  .sticky-actions {
    flex-direction: column;
  }

  .sticky-actions .big-button {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .sidebar {
    width: 85%;
  }

  .panel {
    padding: var(--space-md);
  }

  input, select {
    font-size: 16px; /* Prevents zoom on iOS */
  }

  .energy-header {
    font-size: 1.5em;
  }

  .energy-header img {
    width: 32px;
    height: 32px;
  }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: 8px 16px;
  text-decoration: none;
  z-index: 100;
  border-radius: 0 0 var(--radius-sm) 0;
}

.skip-link:focus {
  top: 0;
}

*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline-offset: -2px;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-center { text-align: center; }
.text-muted { color: var(--color-text-muted); }
.mb-0 { margin-bottom: 0 !important; }
.mt-lg { margin-top: var(--space-lg); }
.hidden { display: none !important; }

/* ========================================
   UX IMPROVEMENTS - NOVICE-FIRST WORKFLOW
   ======================================== */

/* --- 1. Brand header: tighter, cleaner --- */
.brand-header {
  padding: 10px 12px !important;
  gap: 10px !important;
  margin-bottom: 10px !important;
  border-radius: 12px !important;
}

.brand-lockup {
  padding: 11px !important;
  gap: 11px !important;
}

.brand-logo {
  width: 58px !important;
  height: 58px !important;
  border-radius: 10px !important;
}

.brand-title {
  font-size: 22px !important;
  font-weight: 900 !important;
  line-height: 1.12 !important;
  letter-spacing: -0.01em;
  color: var(--color-text-primary) !important;
}

.brand-subtitle {
  font-size: 11px !important;
  color: var(--color-text-muted) !important;
}

/* --- 2. Sidebar close button: de-emphasize on desktop --- */
.sidebar-close {
  font-size: 12px !important;
  color: var(--color-text-muted) !important;
  border-color: var(--color-border) !important;
  border-radius: 8px !important;
  padding: 7px 10px !important;
}

/* --- 3. Stepper: compact, remove verbose sub-state in simple mode --- */
body.ui-simple .stepper-state {
  display: none;
}

body.ui-simple .shortcut-hint {
  display: none;
}

.progress-indicator {
  gap: 4px !important;
  padding: 8px !important;
  background: rgba(46, 125, 50, 0.04) !important;
  border-radius: 10px !important;
  margin-bottom: 14px !important;
}

.stepper-circle {
  width: 30px !important;
  height: 30px !important;
  font-size: 12px !important;
}

.stepper-step {
  min-width: 50px !important;
}

.stepper-label {
  font-size: 10px !important;
}

/* --- 4. Interface mode card: cleaner, less verbose --- */
.ui-mode-card {
  background: linear-gradient(135deg, #f0f9f1, #ffffff) !important;
  border: 1px solid #c8e6c9 !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  margin: 6px 0 10px !important;
}

.ui-mode-toggle {
  gap: 6px !important;
  margin-top: 8px !important;
}

.ui-mode-btn {
  border-radius: 10px !important;
  padding: 7px 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  transition: all 0.15s ease !important;
}

.ui-mode-btn.active {
  background: var(--color-primary) !important;
  border-color: var(--color-primary) !important;
  box-shadow: 0 4px 10px rgba(46, 125, 50, 0.25) !important;
}

/* --- 5. Workflow chips: better visual hierarchy --- */
.workflow-bar {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
  gap: 6px !important;
  margin-top: 8px !important;
}

.workflow-chip {
  min-width: 0 !important;
  padding: 8px 10px !important;
  border-radius: 10px !important;
  background: rgba(255, 255, 255, 0.92) !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06) !important;
  transition: box-shadow 0.15s ease;
}

.workflow-chip:hover {
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.1) !important;
}

.workflow-chip strong {
  font-size: 10px !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  color: #64748b !important;
  margin-bottom: 2px !important;
  overflow-wrap: anywhere !important;
}

.workflow-chip span {
  font-size: 12px !important;
  font-weight: 600 !important;
  color: var(--color-text-primary) !important;
  line-height: 1.3 !important;
  overflow-wrap: anywhere !important;
}

.workflow-chip small {
  font-size: 10px !important;
  color: var(--color-text-muted) !important;
  line-height: 1.3 !important;
  margin-top: 1px !important;
  overflow-wrap: anywhere !important;
}

/* --- 6. Primary CTA button: start area selection --- */
.big-button.primary-button {
  width: 100%;
  margin-right: 0 !important;
  font-size: 15px !important;
  padding: 14px 20px !important;
  border-radius: 12px !important;
  letter-spacing: 0.01em;
}

/* --- 7. Summary lead button: strong conversion driver --- */
.summary-lead-button {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%) !important;
  font-size: 17px !important;
  font-weight: 700 !important;
  padding: 18px 28px !important;
  width: 100% !important;
  border-radius: 14px !important;
  letter-spacing: 0.01em !important;
  box-shadow: 0 12px 30px rgba(234, 88, 12, 0.35) !important;
  border: 1px solid rgba(251, 191, 36, 0.4) !important;
  margin-top: 0 !important;
}

.summary-lead-button:hover {
  box-shadow: 0 16px 38px rgba(234, 88, 12, 0.48) !important;
  transform: translateY(-2px) !important;
}

.summary-scope-strip {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.summary-scope-badge {
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 12px;
  line-height: 1.45;
  border: 1px solid transparent;
}

.summary-scope-badge strong {
  font-weight: 800;
}

.summary-scope-badge.include {
  background: #f0f9ff;
  border-color: #bae6fd;
  color: #0c4a6e;
}

.summary-scope-badge.exclude {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

/* --- Land opportunity decision card --- */
.land-opportunity-card {
  margin-top: 14px;
  border: 1px solid #d9e2ec;
  border-radius: 14px;
  padding: 14px;
  background: linear-gradient(145deg, #ffffff 0%, #f8fbff 100%);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.08);
}

.land-opportunity-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.land-opportunity-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
}

.land-opportunity-subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #64748b;
}

.land-opportunity-refresh {
  margin: 0 !important;
  min-width: 0 !important;
  padding: 9px 12px !important;
  font-size: 12px !important;
  border-radius: 10px !important;
}

.land-opportunity-score-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 12px;
}

.land-opportunity-score-line {
  margin-top: 12px;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 800;
  color: #0f172a;
}

.land-opportunity-metric {
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.land-opportunity-metric-label {
  display: block;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 3px;
}

.land-opportunity-score-value {
  font-size: 28px;
  line-height: 1.1;
  font-weight: 800;
  color: #0f172a;
}

.land-opportunity-score-label {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
}

.land-opportunity-confidence {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 800;
  color: #0f172a;
}

.land-opportunity-confidence[data-confidence="high"] {
  color: #166534;
}

.land-opportunity-confidence[data-confidence="medium-high"] {
  color: #3f6212;
}

.land-opportunity-confidence[data-confidence="medium"] {
  color: #92400e;
}

.land-opportunity-confidence[data-confidence="low"],
.land-opportunity-confidence[data-confidence="very-low"] {
  color: #b91c1c;
}

.land-opportunity-band {
  margin-top: 10px;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
  background: linear-gradient(90deg, #dc2626 0%, #f97316 25%, #facc15 50%, #84cc16 75%, #16a34a 100%);
  position: relative;
}

.land-opportunity-band-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: rgba(15, 23, 42, 0.14);
}

.land-opportunity-band-pointer {
  position: absolute;
  top: -4px;
  width: 2px;
  height: 18px;
  border-radius: 999px;
  background: #0f172a;
  left: 0%;
}

.land-opportunity-card[data-score-band="score-band-very-attractive"] .land-opportunity-band-pointer {
  background: #166534;
}

.land-opportunity-card[data-score-band="score-band-attractive"] .land-opportunity-band-pointer {
  background: #3f6212;
}

.land-opportunity-card[data-score-band="score-band-selective"] .land-opportunity-band-pointer {
  background: #92400e;
}

.land-opportunity-card[data-score-band="score-band-weak"] .land-opportunity-band-pointer {
  background: #c2410c;
}

.land-opportunity-card[data-score-band="score-band-low"] .land-opportunity-band-pointer {
  background: #b91c1c;
}

.land-opportunity-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 12px;
  margin-top: 10px;
  color: #334155;
}

.land-opportunity-row strong {
  color: #0f172a;
}

.land-opportunity-block {
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
}

.land-opportunity-block h4 {
  margin: 0 0 6px;
  font-size: 12px;
  color: #0f172a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.land-opportunity-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  color: #334155;
  font-size: 12px;
}

.land-opportunity-mix {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.land-opportunity-mix-row {
  display: grid;
  grid-template-columns: 112px 1fr auto;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: #334155;
}

.land-opportunity-mix-track {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.land-opportunity-mix-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563eb, #22c55e);
}

.land-opportunity-next {
  margin-top: 12px;
  border-radius: 12px;
  border: 1px solid #dbeafe;
  padding: 10px;
  background: #eff6ff;
}

.land-opportunity-next small {
  color: #334155;
  display: block;
  margin-bottom: 8px;
}

.land-opportunity-next-btn {
  width: 100%;
  margin: 0 !important;
}

.land-opportunity-analysis-toggle {
  margin-top: 10px;
  width: 100%;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #1e293b;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.land-opportunity-analysis-toggle:hover {
  background: #f8fafc;
}

.land-opportunity-empty {
  margin-top: 10px;
  font-size: 12px;
  color: #64748b;
}

/* --- Knowledge upload modal --- */
.knowledge-upload-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
}

.knowledge-upload-dialog {
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #d9e2ec;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  padding: 16px;
  display: grid;
  gap: 8px;
}

.knowledge-upload-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.knowledge-upload-dialog h3 {
  margin: 0;
  font-size: 18px;
  color: #0f172a;
}

.knowledge-upload-x {
  width: 38px;
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #0f172a;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.knowledge-upload-x:hover {
  background: #f8fafc;
}

.knowledge-upload-help {
  margin: 0 0 4px;
  font-size: 12px;
  color: #475569;
}

.knowledge-upload-info-card,
.knowledge-upload-inline-help {
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  padding: 10px 12px;
  font-size: 12px;
  line-height: 1.55;
}

.knowledge-upload-info-card strong,
.knowledge-upload-inline-help strong {
  display: block;
  margin-bottom: 4px;
  color: #0f172a;
}

.knowledge-upload-info-card p,
.knowledge-upload-inline-help p {
  margin: 0;
}

.knowledge-upload-mini-note {
  margin-top: 6px !important;
  color: #475569;
}

.knowledge-upload-inline-help ul {
  margin: 6px 0 0 16px;
  padding: 0;
}

.knowledge-upload-inline-help li + li {
  margin-top: 4px;
}

.knowledge-upload-dialog label {
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.knowledge-upload-dialog input,
.knowledge-upload-dialog select,
.knowledge-upload-dialog textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 12px;
  background: #fff;
  color: #0f172a;
}

.knowledge-upload-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.knowledge-upload-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  padding: 8px 10px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
}

.knowledge-upload-actions label {
  display: flex;
  gap: 6px;
  align-items: center;
  font-weight: 600;
  font-size: 12px;
}

.knowledge-upload-actions input[type="checkbox"] {
  width: auto;
}

.knowledge-upload-status {
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  white-space: pre-line;
}

.knowledge-upload-status[data-tone="success"] {
  border-color: #86efac;
  background: #f0fdf4;
  color: #166534;
}

.knowledge-upload-status[data-tone="warning"] {
  border-color: #fcd34d;
  background: #fffbeb;
  color: #92400e;
}

.knowledge-upload-result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.knowledge-upload-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 760px) {
  .knowledge-upload-grid,
  .knowledge-upload-actions {
    grid-template-columns: 1fr;
  }
}

/* --- Advanced Geothermal Intelligence workspace --- */
.geo-intel-panel {
  position: absolute;
  inset: 12px;
  z-index: 1090;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.24);
  padding: 12px;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 10px;
  overflow: auto;
  align-content: start;
}

.geo-intel-panel.hidden {
  display: none;
}

.geo-intel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}

.geo-intel-title {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
}

.geo-intel-subtitle {
  font-size: 12px;
  color: #475569;
}

.geo-intel-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.9), rgba(248, 250, 252, 0.95));
  padding: 10px 12px;
}

.geo-intel-context-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.geo-intel-context-copy strong {
  font-size: 12px;
  color: #0f172a;
}

.geo-intel-context-meta {
  font-size: 12px;
  color: #334155;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.geo-intel-context-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.geo-intel-context-actions .geo-intel-inline-action {
  margin: 0;
}

.geo-intel-partner-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #fffbeb 100%);
  box-shadow: 0 10px 22px rgba(245, 158, 11, 0.08);
}

.geo-intel-partner-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.geo-intel-partner-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 13px;
  font-weight: 900;
  color: #0f172a;
}

.geo-intel-partner-note {
  font-size: 12px;
  line-height: 1.45;
  color: #7c2d12;
}

.geo-intel-partner-button {
  margin: 0;
  padding: 9px 14px;
  color: #7c2d12;
  border-color: rgba(245, 158, 11, 0.62);
  background: #fff;
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.16);
}

.geo-intel-partner-button:hover {
  background: #fffbeb;
}

.geo-intel-body {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(420px, 1.1fr);
  gap: 14px;
  min-height: 0;
  align-items: start;
  position: relative;
  z-index: 2;
  overflow: hidden;
}

.geo-intel-column {
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  overflow: hidden;
  min-height: 520px;
  max-height: min(58vh, 680px);
  min-width: 0;
  position: relative;
}

.geo-intel-map-column,
.geo-intel-evidence-column {
  display: grid;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

.geo-intel-map-column::after,
.geo-intel-evidence-column::after {
  content: "";
  position: sticky;
  left: 0;
  right: 0;
  bottom: 0;
  display: block;
  height: 24px;
  margin-top: -24px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgba(248, 250, 252, 0.96));
  z-index: 4;
}

.geo-intel-map-head,
.geo-intel-evidence-head {
  position: sticky;
  top: -10px;
  z-index: 5;
  margin: -10px -10px 8px;
  padding: 10px 10px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(255, 255, 255, 0.96) 80%, rgba(255, 255, 255, 0) 100%);
  backdrop-filter: blur(6px);
}

.geo-intel-column h4 {
  margin: 0;
  font-size: 13px;
  color: #0f172a;
}

.geo-intel-column small {
  color: #64748b;
  font-size: 11px;
}

.geo-intel-layer-list {
  margin-top: 10px;
  display: grid;
  gap: 7px;
  min-height: 380px;
  align-content: start;
}

.geo-intel-layer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  font-size: 12px;
  color: #1e293b;
  font-weight: 600;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.geo-intel-layer-row.is-disabled {
  opacity: 0.72;
}

.geo-intel-layer-row.is-planned {
  grid-template-columns: minmax(0, 1fr) auto;
  background: #f8fafc;
  border-style: dashed;
}

.geo-intel-layer-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.geo-intel-layer-label {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.35;
  word-break: break-word;
}

.geo-intel-layer-meta {
  margin-top: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
}

.geo-intel-layer-meta.is-loaded {
  color: #166534;
}

.geo-intel-layer-help {
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
  font-weight: 800;
  cursor: help;
}

.geo-intel-layer-help:hover {
  background: #eff6ff;
}

.geo-intel-map-note {
  margin-top: 10px;
  font-size: 11px;
  color: #475569;
  line-height: 1.4;
}

.geo-intel-layer-help-note {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: #334155;
  line-height: 1.5;
}

.geo-intel-layer-help-note strong {
  color: #0f172a;
}

.geo-intel-planned-layers {
  margin-top: 10px;
  border-top: 1px dashed #cbd5e1;
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.geo-intel-planned-note {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
}

.geo-intel-planned-note strong {
  color: #0f172a;
  font-size: 12px;
}

.geo-intel-planned-list {
  display: grid;
  gap: 7px;
}

.geo-intel-partner-datasets {
  margin-top: 10px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  padding: 10px;
  background: #fffbeb;
  display: grid;
  gap: 8px;
}

.geo-intel-partner-datasets:not(.is-open) .geo-intel-partner-dataset-list {
  display: none;
}

.geo-intel-partner-datasets-head {
  margin: 0;
}

.geo-intel-partner-dataset-list {
  display: grid;
  gap: 7px;
}

.geo-intel-layer-row.is-partner {
  background: #fff;
  border-color: rgba(245, 158, 11, 0.35);
}

.geo-intel-layer-row.is-planned .geo-intel-pill {
  align-self: start;
  margin-top: 2px;
}

.geo-intel-layer-row.is-loaded {
  border-color: rgba(34, 197, 94, 0.24);
  box-shadow: 0 14px 28px rgba(34, 197, 94, 0.08);
}

.geo-intel-layer-row.is-empty-result {
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.08);
}

.map-catalog-badge.tier-default {
  background: #dbeafe;
  color: #1d4ed8;
}

.map-catalog-badge.tier-advanced {
  background: #ede9fe;
  color: #6d28d9;
}

.map-catalog-badge.tier-expert {
  background: #fee2e2;
  color: #991b1b;
}

.geo-intel-evidence-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.geo-intel-evidence-head label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  color: #334155;
  font-weight: 700;
}

.geo-intel-evidence-head select {
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 4px 6px;
  font-size: 12px;
  color: #0f172a;
  background: #fff;
}

.geo-intel-evidence-list {
  display: grid;
  gap: 8px;
  min-height: 340px;
  align-content: start;
}

.geo-intel-evidence-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 8px;
}

.geo-intel-evidence-toolbar .big-button {
  margin: 0;
  padding: 8px 12px;
}

.geo-intel-evidence-card {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #f8fafc;
  display: grid;
  gap: 5px;
}

.geo-intel-evidence-headline {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.geo-intel-evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: #334155;
}

.geo-intel-evidence-snippet {
  font-size: 12px;
  color: #1e293b;
}

.geo-intel-evidence-source {
  font-size: 11px;
  color: #64748b;
}

.geo-intel-empty {
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  padding: 10px;
  font-size: 12px;
  color: #64748b;
  background: #f8fafc;
}

.geo-intel-empty-note {
  margin-top: 6px;
  line-height: 1.5;
}

.geo-intel-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.geo-intel-empty-actions .big-button {
  margin: 0;
  padding: 8px 12px;
  font-size: 12px;
}

.geo-intel-subsection {
  margin-top: 12px;
  border-top: 1px solid #e2e8f0;
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.geo-intel-subhead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.geo-intel-subhead h5 {
  margin: 0;
  font-size: 12px;
  color: #0f172a;
}

.geo-intel-subhead small {
  display: block;
  margin-top: 2px;
  line-height: 1.45;
}

.geo-intel-subcount {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  white-space: nowrap;
}

.geo-intel-subhead-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.geo-intel-inline-action {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  color: #1e293b;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.geo-intel-inline-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.geo-intel-selected-list,
.geo-intel-payload-preview,
.geo-intel-knowledge-list,
.geo-intel-action-list {
  display: grid;
  gap: 8px;
}

.geo-intel-selected-row,
.geo-intel-payload-card,
.geo-intel-knowledge-card,
.geo-intel-action-row {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.geo-intel-action-row.is-primary {
  border-color: #bbf7d0;
  background: #f0fdf4;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.12);
}

.geo-intel-selected-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.geo-intel-selected-title,
.geo-intel-knowledge-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.geo-intel-selected-meta,
.geo-intel-knowledge-subtitle {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: #475569;
}

.geo-intel-selected-snippet,
.geo-intel-knowledge-note,
.geo-intel-action-note {
  margin-top: 6px;
  font-size: 12px;
  color: #334155;
  line-height: 1.45;
}

.geo-intel-selected-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.geo-intel-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #e2e8f0;
  color: #334155;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.geo-intel-pill.is-open {
  background: #dcfce7;
  color: #166534;
  border-color: rgba(34, 197, 94, 0.45);
  box-shadow: 0 8px 18px rgba(34, 197, 94, 0.18);
}

.geo-intel-pill.is-ready {
  background: #dbeafe;
  color: #1d4ed8;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.16);
}

.geo-intel-pill.is-info {
  background: #fef3c7;
  color: #92400e;
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 8px 18px rgba(245, 158, 11, 0.16);
}

.geo-intel-pill.is-muted,
.geo-intel-pill.is-soft {
  background: #e2e8f0;
  color: #475569;
  border-color: rgba(148, 163, 184, 0.4);
}

.geo-intel-knowledge-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.geo-intel-knowledge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.geo-intel-knowledge-actions .big-button {
  min-width: 0;
}

.geo-intel-knowledge-toolbar {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.geo-intel-workflow-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
}

.geo-intel-workflow-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border: 1px solid #dbe5ef;
  border-radius: 10px;
  background: #f8fafc;
}

.geo-intel-workflow-step.is-open {
  border-color: rgba(37, 99, 235, 0.28);
  background: #eff6ff;
}

.geo-intel-workflow-step.is-done {
  border-color: rgba(22, 163, 74, 0.28);
  background: #f0fdf4;
}

.geo-intel-workflow-step strong,
.geo-intel-workflow-step span {
  display: block;
}

.geo-intel-workflow-step strong {
  font-size: 12px;
  color: #0f172a;
}

.geo-intel-workflow-step span {
  margin-top: 3px;
  font-size: 12px;
  color: #475569;
  line-height: 1.4;
}

.geo-intel-workflow-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 12px;
}

.geo-intel-workflow-step.is-done .geo-intel-workflow-step-num {
  background: #dcfce7;
  color: #166534;
}

.geo-intel-workflow-arrow {
  align-self: center;
  color: #64748b;
  font-weight: 800;
}

.geo-intel-scan-section {
  display: grid;
  gap: 10px;
}

.geo-intel-evidence-card.is-summary {
  border-color: rgba(37, 99, 235, 0.2);
  background: linear-gradient(180deg, #f8fbff 0%, #eef6ff 100%);
}

.geo-intel-upload-review {
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  padding: 10px;
  background: #eff6ff;
}

.geo-intel-latest-upload-slot {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

.geo-intel-upload-review-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.geo-intel-upload-review-note {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
  color: #334155;
}

.geo-intel-payload-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.geo-intel-payload-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  text-transform: capitalize;
}

.geo-intel-payload-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #475569;
}

.geo-intel-payload-note {
  margin-top: 8px;
  font-size: 12px;
  color: #334155;
  line-height: 1.45;
}

.geo-intel-payload-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
}

.geo-intel-payload-grid span {
  display: block;
  font-size: 11px;
  color: #64748b;
}

.geo-intel-payload-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
  color: #0f172a;
}

.geo-intel-payload-blocks {
  margin-top: 10px;
  font-size: 11px;
  color: #475569;
  line-height: 1.45;
}

.geo-intel-payload-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.geo-intel-payload-citations {
  margin-top: 10px;
  border-top: 1px solid #e2e8f0;
  padding-top: 10px;
  display: grid;
  gap: 8px;
}

.geo-intel-payload-citations strong {
  font-size: 12px;
  color: #0f172a;
}

.geo-intel-payload-citation-list {
  display: grid;
  gap: 8px;
}

.geo-intel-payload-citation {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.geo-intel-payload-citation-copy {
  min-width: 0;
}

.geo-intel-payload-citation-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
}

.geo-intel-payload-citation-meta {
  margin-top: 2px;
  font-size: 11px;
  color: #64748b;
  word-break: break-word;
}

.geo-intel-workflow-checklist {
  margin-top: 12px;
  border-top: 1px solid #dbeafe;
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.geo-intel-workflow-guide {
  margin-top: 12px;
  border-top: 1px solid #dbeafe;
  padding-top: 12px;
  display: grid;
  gap: 8px;
}

.geo-intel-guide-steps {
  display: grid;
  gap: 8px;
}

.geo-intel-guide-step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.geo-intel-guide-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 30px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.geo-intel-guide-step-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.geo-intel-guide-step-note,
.geo-intel-guide-next {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}

.geo-intel-guide-next {
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.geo-intel-checklist {
  display: grid;
  gap: 8px;
}

.geo-intel-checklist-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  background: #f8fafc;
}

.geo-intel-checklist-row.is-done {
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.geo-intel-checklist-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #dbeafe;
  color: #1d4ed8;
}

.geo-intel-checklist-row.is-done .geo-intel-checklist-badge {
  background: #dcfce7;
  color: #166534;
}

.geo-intel-checklist-title {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
}

.geo-intel-checklist-note {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: #475569;
}

.geo-intel-decision {
  border: 1px solid #dbe5ef;
  border-radius: 12px;
  padding: 10px;
  background: #ffffff;
  overflow: auto;
  position: relative;
  z-index: 1;
}

.geo-intel-decision h4 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #0f172a;
}

.geo-intel-metrics {
  display: grid;
  gap: 8px;
}

.geo-intel-assumption-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  padding: 10px 12px;
  background: #f8fbff;
}

.geo-intel-assumption-copy {
  display: grid;
  gap: 3px;
  min-width: 220px;
  flex: 1 1 220px;
}

.geo-intel-assumption-copy strong {
  font-size: 12px;
  color: #0f172a;
}

.geo-intel-assumption-copy span {
  font-size: 11px;
  color: #64748b;
}

.geo-intel-stepper {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.geo-intel-stepper button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  background: #ffffff;
  color: #0f172a;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.geo-intel-stepper button:hover {
  background: #eff6ff;
}

.geo-intel-stepper input {
  width: 78px;
  min-height: 34px;
  text-align: center;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  background: #ffffff;
}

.geo-intel-stepper-note {
  font-size: 11px;
  color: #64748b;
}

.geo-intel-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.geo-intel-metric {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 8px;
  background: #f8fafc;
  display: grid;
  gap: 3px;
}

.geo-intel-metric span {
  font-size: 11px;
  color: #64748b;
}

.geo-intel-metric strong {
  font-size: 13px;
  color: #0f172a;
}

.geo-intel-decision-block {
  margin-top: 10px;
  border: 1px solid #dbeafe;
  border-radius: 10px;
  background: #eff6ff;
  padding: 10px;
}

.geo-intel-evidence-strength {
  font-size: 12px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.geo-intel-decision-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
}

.geo-intel-decision-grid span {
  display: block;
  font-size: 11px;
  color: #475569;
}

.geo-intel-decision-grid strong {
  font-size: 13px;
  color: #0f172a;
}

.geo-intel-next-step {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #dbeafe;
}

.geo-intel-next-step strong {
  display: block;
  font-size: 12px;
  color: #0f172a;
}

.geo-intel-next-step p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #1e293b;
}

.geo-intel-drilling-rationale {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #dbeafe;
}

.geo-intel-drilling-rationale strong {
  display: block;
  font-size: 12px;
  color: #0f172a;
}

.geo-intel-drilling-rationale p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #1e293b;
}

.geo-intel-inline-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-style: normal;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.geo-intel-next-actions {
  margin-top: 12px;
  border-top: 1px solid #dbeafe;
  padding-top: 12px;
  position: relative;
  z-index: 4;
}

.geo-intel-action-status {
  display: none;
  margin-top: 10px;
  border: 1px solid #cbd5e1;
  border-left-width: 4px;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.45;
  color: #334155;
  background: #f8fafc;
  position: relative;
  z-index: 4;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.geo-intel-action-status-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.geo-intel-action-status-message {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.geo-intel-action-status[data-tone="success"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.geo-intel-action-status[data-tone="warning"] {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

.geo-intel-action-status[data-tone="info"] {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.geo-intel-panel-footer-actions {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
}

.geo-intel-action-row .big-button {
  width: 100%;
  margin: 0;
}

@media (max-width: 980px) {
  .geo-intel-body {
    grid-template-columns: 1fr;
  }

  .geo-intel-column {
    min-height: 420px;
    max-height: min(48vh, 520px);
  }

  .geo-intel-selected-row {
    grid-template-columns: 1fr;
  }

  .geo-intel-selected-actions {
    justify-items: start;
  }

  .geo-intel-workflow-strip {
    grid-template-columns: 1fr;
  }

  .geo-intel-workflow-arrow {
    display: none;
  }
}

/* --- 8. Investor-grade report upgrade banner --- */
.upgrade-report-banner {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 100%);
  border-radius: 16px;
  padding: 20px;
  margin: 16px 0 10px;
  color: #fff;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.3);
}

.upgrade-report-banner h3 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-family-heading);
}

.upgrade-report-banner p {
  margin: 0 0 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
}

.upgrade-report-price {
  display: block;
  font-size: 13px;
  color: #fbbf24;
  font-weight: 700;
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}

.upgrade-report-cta {
  display: block !important;
  width: 100% !important;
  background: linear-gradient(135deg, #fbbf24 0%, #f97316 100%) !important;
  color: #0f172a !important;
  border: none !important;
  border-radius: 12px !important;
  padding: 14px 20px !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  text-align: center !important;
  box-shadow: 0 8px 24px rgba(249, 115, 22, 0.45) !important;
  transition: all 0.2s ease !important;
  letter-spacing: 0.01em !important;
  min-width: 0 !important;
  margin: 0 0 8px !important;
}

.upgrade-report-cta:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 14px 32px rgba(249, 115, 22, 0.55) !important;
}

.upgrade-report-secondary {
  display: block !important;
  width: 100% !important;
  background: rgba(255, 255, 255, 0.1) !important;
  color: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer !important;
  text-decoration: none !important;
  text-align: center !important;
  transition: all 0.2s ease !important;
  min-width: 0 !important;
  margin: 0 !important;
}

.upgrade-report-secondary:hover {
  background: rgba(255, 255, 255, 0.18) !important;
}

.upgrade-report-placeholder {
  opacity: 0.7 !important;
  cursor: not-allowed !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: rgba(255, 255, 255, 0.75) !important;
}

/* --- 9. Map legend: improved readability --- */
.map-layer-legend {
  border-radius: 14px !important;
  border: 1px solid rgba(203, 213, 225, 0.85) !important;
  backdrop-filter: blur(12px) !important;
  max-height: min(42vh, 380px) !important;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16) !important;
}

.map-layer-legend-head {
  padding-bottom: 8px !important;
  border-bottom: 1px solid #f1f5f9;
  margin-bottom: 8px !important;
}

.map-layer-legend-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.map-layer-legend-title {
  font-size: 13px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.map-layer-legend-title::before {
  content: "◉";
  font-size: 10px;
  color: var(--color-primary);
}

.map-layer-legend-empty {
  font-size: 12px !important;
  color: var(--color-text-muted) !important;
  padding: 8px 0 4px !important;
  line-height: 1.5 !important;
}

.map-layer-legend-help {
  font-size: 11px !important;
  color: #64748b !important;
  line-height: 1.4 !important;
  margin-top: 4px !important;
  max-width: 260px;
}

.map-layer-legend-action {
  font-size: 11px !important;
  padding: 5px 10px !important;
  border-radius: 999px !important;
  background: var(--color-primary) !important;
  color: #fff !important;
  border: none !important;
  font-weight: 700 !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.map-layer-legend-action:hover {
  background: var(--color-primary-hover) !important;
  transform: translateY(-1px) !important;
}

.map-layer-legend-close {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #dbe3ec;
  background: #fff;
  color: #0f172a;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.map-layer-legend-launcher {
  position: absolute;
  top: 16px;
  left: 164px;
  right: auto;
  bottom: auto;
  z-index: 1091;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

@media (max-width: 720px) {
  .map-layer-legend-launcher {
    top: 58px;
    left: auto;
    right: 10px;
    padding: 9px 12px;
  }
}

.map-layer-row {
  border-radius: 10px !important;
  padding: 7px 9px !important;
  background: #fdfdfd !important;
  border-color: #f1f5f9 !important;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(186px, 236px) !important;
  gap: 10px !important;
}

.map-layer-status {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.map-layer-status .geo-intel-pill {
  padding: 3px 9px;
  font-size: 9px;
}

.map-layer-row input[type="range"].map-layer-opacity {
  width: 100% !important;
}

.map-layer-inline-opacity {
  display: grid !important;
  grid-template-columns: auto minmax(104px, 1fr) 42px !important;
  align-items: center !important;
  gap: 8px !important;
  min-width: 186px !important;
  color: #475569 !important;
  font-size: 10px !important;
  font-weight: 900 !important;
  white-space: nowrap !important;
}

.map-layer-inline-opacity .map-layer-opacity-name {
  text-align: left !important;
}

.map-layer-inline-opacity .map-layer-opacity-value {
  min-width: 38px !important;
  color: #ea580c !important;
  text-align: right !important;
}

.map-layer-inline-opacity input[type="range"] {
  width: 100% !important;
  margin: 0 !important;
  accent-color: #f97316 !important;
}

.map-layer-legend-items {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.map-layer-legend-item {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
}

.map-layer-legend-chip {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.map-layer-legend-item-label {
  font-size: 11px;
  color: #475569;
  line-height: 1.35;
}

.map-layer-legend-title::before {
  content: "◉" !important;
}

.map-layer-legend-size-controls {
  display: inline-flex !important;
  gap: 4px !important;
  padding: 3px !important;
  border-radius: 999px !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
}

.map-layer-legend-size-controls button {
  border: none !important;
  border-radius: 999px !important;
  background: transparent !important;
  color: #334155 !important;
  padding: 2px 8px !important;
  font-size: 10px !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.map-layer-legend-size-controls button.active {
  background: #1d4ed8 !important;
  color: #fff !important;
}

.map-layer-range-controls {
  grid-column: 2 / -1 !important;
  display: grid !important;
  gap: 4px !important;
  margin-top: 2px !important;
}

.map-layer-range-sliders {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

.map-layer-range-sliders input[type="range"] {
  width: 100% !important;
  margin: 0 !important;
}

.map-layer-range-inputs {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
}

/* Hide color picker, range inputs, and include toggle in simple mode to reduce clutter */
body.ui-simple .map-layer-color,
body.ui-simple .map-layer-range,
body.ui-simple .map-layer-action:not(.remove-action) {
  display: none !important;
}

.print-button {
  background: linear-gradient(135deg, #2e7d32, #256b2a) !important;
  color: #fff !important;
  box-shadow: 0 8px 18px rgba(46, 125, 50, 0.22) !important;
}

.print-button:hover {
  background: linear-gradient(135deg, #368e3b, #2c7f31) !important;
}

/* --- 10. Map help overlay: improved positioning signal --- */
.map-help-overlay {
  border-radius: 14px !important;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.32) !important;
}

.map-help-title {
  font-size: 14px !important;
  font-weight: 800 !important;
}

/* --- 11. Map data launcher button: cleaner --- */
.map-data-launcher {
  border-radius: 10px !important;
  font-size: 12px !important;
  padding: 9px 13px !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

.map-workspace-launcher {
  position: absolute;
  top: 16px;
  left: 286px;
  z-index: 1091;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  color: #0f172a;
  padding: 10px 13px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.map-workspace-launcher.is-active {
  background: rgba(239, 246, 255, 0.98);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.14);
}

.map-workspace-launcher-secondary {
  left: 418px;
}

.map-workspace-launcher-tertiary {
  left: 550px;
}

.map-workspace-launcher-quaternary {
  left: 694px;
}

.map-workspace-launcher-quinary {
  left: 846px;
}

.map-workspace-overlay {
  position: absolute;
  top: 58px;
  left: 14px;
  z-index: 1088;
  width: min(460px, calc(100vw - 28px));
  max-height: min(76vh, 760px);
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #dbe3ec;
  background: rgba(255, 255, 255, 0.98);
  color: #0f172a;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
  display: flex;
  flex-direction: column;
}

.map-workspace-overlay.hidden {
  display: none;
}

.map-workspace-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid #e2e8f0;
  background: linear-gradient(180deg, #f8fbff 0%, rgba(255,255,255,0.98) 100%);
}

.map-workspace-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.map-workspace-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
}

.map-workspace-close {
  border: 1px solid #dbe3ec;
  background: #fff;
  color: #0f172a;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  flex: 0 0 auto;
}

.map-workspace-status {
  padding: 10px 12px 0;
  font-size: 12px;
  color: #475569;
}

.map-workspace-body {
  overflow: auto;
  padding: 10px 12px 12px;
}

.map-workspace-body #advancedGlobalDatasetsSection {
  margin-top: 0 !important;
  padding-top: 0 !important;
  border-top: none !important;
}

@media (max-width: 720px) {
  .map-workspace-launcher {
    top: 58px;
    left: 140px;
    padding: 9px 12px;
  }

  .map-workspace-launcher-secondary {
    left: 258px;
  }

  .map-workspace-launcher-tertiary {
    left: 140px;
    top: 102px;
  }

  .map-workspace-launcher-quaternary {
    left: 258px;
    top: 102px;
  }

  .map-workspace-launcher-quinary {
    left: 140px;
    top: 146px;
  }

  .map-workspace-overlay {
    top: 106px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: 66vh;
  }
}

/* --- 12. Required callout: cleaner visual --- */
.required-callout {
  border-left-width: 3px !important;
  border-radius: 10px !important;
  background: #eff6ff !important;
  color: #1e3a8a !important;
  font-size: 13px !important;
  line-height: 1.5 !important;
}

/* --- 13. Panel context card: clean subtle info block --- */
.panel-context {
  border-radius: 10px !important;
  background: #f8fbff !important;
  border: 1px solid #dbe3ec !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

/* --- 14. Disclosure card: cleaner collapsible --- */
.disclosure-card {
  border-radius: 12px !important;
  border-color: #e2e8f0 !important;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05) !important;
}

.disclosure-card summary {
  font-size: 13px !important;
  border-radius: 11px !important;
  padding: 10px 13px !important;
}

/* --- 15. Backend status badge: less prominent, label truncated --- */
.backend-status {
  font-size: 10px !important;
  padding: 4px 8px !important;
  border-radius: 999px !important;
  max-width: 200px !important;
  overflow: hidden !important;
}

.backend-status-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 160px;
}

/* Hide verbose stepper sub-state in simple mode */
body.ui-simple .stepper-state {
  display: none !important;
}

/* Legend: hide color/opacity controls in simple mode, only show layer name + remove */
body.ui-simple .map-layer-legend .map-layer-color,
body.ui-simple .map-layer-legend input[type="range"],
body.ui-simple .map-layer-legend input[type="number"],
body.ui-simple .map-layer-legend input[type="checkbox"] {
  display: none !important;
}

/* --- 16. Info area (paid report card): make it stand out --- */
.info-area {
  border-radius: 12px !important;
  border-color: #e2e8f0 !important;
  background: #f8fafc !important;
}

/* --- 17. State badge improvements --- */
.state-badge {
  font-size: 10px !important;
  padding: 3px 8px !important;
}

/* --- 18. Review card improvements --- */

/* --- Advanced mode map utilities: constrain launchers and panels to the map stage --- */
body.ui-advanced #map #mapDataLauncher.map-data-launcher,
body.ui-advanced #map #mapLayerLegendLauncher.map-layer-legend-launcher {
  position: absolute !important;
  top: auto !important;
  bottom: 18px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: 180px !important;
  height: auto !important;
  min-height: 0 !important;
  max-height: 38px !important;
  padding: 9px 12px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  font-weight: 800 !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  z-index: 1097 !important;
}

body.ui-advanced #map #mapDataLauncher.map-data-launcher {
  right: calc(var(--advanced-insight-width, 360px) + 34px) !important;
}

body.ui-advanced #map #mapLayerLegendLauncher.map-layer-legend-launcher {
  display: none !important;
}

body.ui-advanced #map #mapDataPicker.map-data-picker,
body.ui-advanced #map #mapCatalogPanel.map-catalog-panel,
body.ui-advanced #map #mapLayerLegend.map-layer-legend {
  position: absolute !important;
  top: auto !important;
  left: auto !important;
  right: calc(var(--advanced-insight-width, 360px) + 34px) !important;
  bottom: 70px !important;
  width: min(380px, calc(100% - var(--advanced-insight-width, 360px) - 68px)) !important;
  min-width: min(300px, calc(100% - var(--advanced-insight-width, 360px) - 68px)) !important;
  max-width: min(420px, calc(100% - var(--advanced-insight-width, 360px) - 68px)) !important;
  max-height: min(52vh, 480px) !important;
  overflow: auto !important;
  z-index: 1096 !important;
}

body.ui-advanced #map #mapDataPicker.hidden,
body.ui-advanced #map #mapLayerLegend.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  body.ui-advanced #map #mapDataLauncher.map-data-launcher,
  body.ui-advanced #map #mapLayerLegendLauncher.map-layer-legend-launcher {
    right: 12px !important;
    max-width: calc(100% - 24px) !important;
  }

  body.ui-advanced #map #mapDataLauncher.map-data-launcher {
    top: 12px !important;
    bottom: auto !important;
  }

  body.ui-advanced #map #mapLayerLegendLauncher.map-layer-legend-launcher {
    top: 58px !important;
    bottom: auto !important;
  }

  body.ui-advanced #map #mapDataPicker.map-data-picker,
  body.ui-advanced #map #mapCatalogPanel.map-catalog-panel,
  body.ui-advanced #map #mapLayerLegend.map-layer-legend {
    top: 104px !important;
    left: 12px !important;
    right: 12px !important;
    bottom: auto !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    max-height: min(66vh, 560px) !important;
  }
}
.review-card {
  border-radius: 12px !important;
  border-color: #e2e8f0 !important;
}

/* --- 19. Smooth panel transitions --- */
.panel {
  animation: panelSlideIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

@keyframes panelSlideIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --- 20. Sticky nav: cleaner gradient fade --- */
.sticky-nav {
  background: linear-gradient(180deg,
    rgba(255,255,255,0) 0%,
    rgba(255,255,255,0.96) 36%,
    #fff 72%) !important;
  padding-top: 14px !important;
  padding-bottom: 8px !important;
}

.sticky-nav .big-button {
  margin-top: 0 !important;
  margin-right: 0 !important;
}
