/* EG Ronda Oil & Gas Licensing Portal
   Republic of Equatorial Guinea • Ministry of Hydrocarbons, Mines and Electricity (MHME)
   Produced by Perceptum Limited
*/

:root {
  --primary-navy: #0f172a;
  --header-bg: #131d2a;
  --header-border: #1e293b;
  --header-text: #ffffff;
  --header-subtext: #94a3b8;
  --accent-gold: #f59e0b;
  --accent-gold-hover: #d97706;
  --accent-blue: #0284c7;
  --accent-blue-hover: #0369a1;
  --accent-cyan: #06b6d4;
  --emerald-green: #10b981;
  --border-color: #e2e8f0;
  --panel-bg: #ffffff;
  --panel-header-bg: #f8fafc;
  --panel-text: #1e293b;
  --panel-muted: #64748b;
  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-standard: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-elevated: 0 10px 25px -5px rgba(0, 0, 0, 0.15), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  --shadow-modal: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 9999px;
  --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--panel-text);
  background-color: #0b1320;
  -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Top Header Bar (Executive Government Navigation)
   ========================================================================== */
#header-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: linear-gradient(180deg, #182333 0%, #101926 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--header-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  z-index: 1000;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
  user-select: none;
}

.brand-section {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 100%;
  cursor: pointer;
}

/* Government & Partner Emblem Badges */
.logo-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: var(--radius-sm);
  padding: 2px 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform var(--transition-fast);
}

.logo-badge:hover {
  transform: scale(1.04);
}

.logo-ministry {
  height: 38px;
  width: 38px;
  object-fit: contain;
  border-radius: 50%;
}

.logo-ronda {
  height: 32px;
  width: auto;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 28px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0 2px;
}

.brand-titles {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
}

.brand-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  color: #ffffff;
  white-space: nowrap;
}

.brand-tag {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #000;
  padding: 1px 6px;
  border-radius: 4px;
}

.brand-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: #94a3b8;
  white-space: nowrap;
}

/* Header Right Area */
.header-right-area {
  display: flex;
  align-items: center;
  gap: 14px;
  height: 100%;
}

.partner-badge-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-pill);
  font-size: 11px;
  color: #cbd5e1;
}

.partner-logo-img {
  height: 18px;
  width: auto;
  object-fit: contain;
  background: #ffffff;
  border-radius: 2px;
  padding: 1px 3px;
}

.header-tools {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 4px;
}

.header-btn {
  height: 34px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  color: #e2e8f0;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background-color: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  transform: translateY(-1px);
}

.header-btn.active {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border-color: #38bdf8;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(2, 132, 199, 0.5);
}

.header-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* ==========================================================================
   Map Viewport & Canvas
   ========================================================================== */
#map-viewport {
  position: absolute;
  top: 52px;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1;
}

#map {
  width: 100%;
  height: 100%;
  background-color: #0c1a2e;
  cursor: grab;
}

#map:active,
.leaflet-dragging,
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-interactive,
.leaflet-dragging .leaflet-marker-icon {
  cursor: grabbing !important;
}

/* Leaflet Zoom control overhaul */
.leaflet-control-zoom {
  border: none !important;
  box-shadow: var(--shadow-standard) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(8px);
}

.leaflet-control-zoom a {
  width: 32px !important;
  height: 32px !important;
  line-height: 32px !important;
  color: #1e293b !important;
  font-size: 16px !important;
  font-weight: 600 !important;
  border: none !important;
  border-bottom: 1px solid #e2e8f0 !important;
  transition: background-color var(--transition-fast);
}

.leaflet-control-zoom a:hover {
  background-color: #f1f5f9 !important;
  color: var(--accent-blue) !important;
}

.leaflet-control-zoom a:last-child {
  border-bottom: none !important;
}

/* ==========================================================================
   KPI Quick-Stats Floating Bar
   ========================================================================== */
.map-kpi-bar {
  position: absolute;
  top: 14px;
  left: 308px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-pill);
  padding: 3px 12px;
  box-shadow: var(--shadow-elevated);
  user-select: none;
  max-width: calc(100vw - 308px - 380px);
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

body.sidebar-closed .map-kpi-bar {
  max-width: calc(100vw - 308px - 30px);
}

.kpi-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #e2e8f0;
  cursor: pointer;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  transition: all var(--transition-fast);
}

.kpi-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.kpi-chip .kpi-num {
  font-weight: 700;
  color: var(--accent-cyan);
}

.kpi-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
}

/* ==========================================================================
   On-Map Floating Controls (Search & Action Tools)
   ========================================================================== */
.map-overlay-left {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.map-overlay-left > * {
  pointer-events: auto;
}

/* Search Widget */
.search-widget {
  position: relative;
  width: 290px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  overflow: hidden;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.search-widget:focus-within {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.2), var(--shadow-elevated);
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  flex: 1;
  padding: 0 10px;
  height: 38px;
}

.search-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 13px;
  color: #1e293b;
  background: transparent;
}

.search-input::placeholder {
  color: #94a3b8;
}

.search-clear-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: #94a3b8;
  display: none;
}

.search-clear-btn:hover {
  color: #1e293b;
}

.search-btn {
  background: #f8fafc;
  border: none;
  border-left: 1px solid #e2e8f0;
  height: 38px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
  transition: all var(--transition-fast);
}

.search-btn:hover {
  background: var(--accent-blue);
  color: #ffffff;
}

.search-btn svg, .search-clear-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Search Suggestions */
.search-suggestions {
  position: absolute;
  top: 42px;
  left: 0;
  right: 0;
  background: #ffffff;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  z-index: 600;
  border: 1px solid #e2e8f0;
}

.search-suggestion-item {
  padding: 9px 12px;
  font-size: 12px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background-color var(--transition-fast);
}

.search-suggestion-item:hover {
  background-color: #f0f9ff;
}

.suggestion-name {
  font-weight: 600;
  color: #0369a1;
}

.suggestion-type {
  font-size: 10px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  background: #e2e8f0;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

/* Unified Vertical Map Toolbar */
.map-vertical-toolbar {
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  padding: 3px;
  width: 34px;
}

.toolbar-btn {
  width: 28px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #334155;
  transition: all var(--transition-fast);
}

.toolbar-btn:hover {
  background: #f1f5f9;
  color: var(--accent-blue);
  transform: scale(1.05);
}

.toolbar-btn:active {
  background: #e2e8f0;
}

.toolbar-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
}

.toolbar-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.toolbar-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 3px 2px;
}

/* ==========================================================================
   Bottom Left Bar (Scalebar & Coordinates)
   ========================================================================== */
.map-bottom-left {
  position: absolute;
  bottom: 12px;
  left: 14px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  font-size: 11px;
  user-select: none;
}

.scalebar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(6px);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: var(--shadow-subtle);
}

.scalebar-line {
  border-left: 2px solid #0f172a;
  border-right: 2px solid #0f172a;
  border-bottom: 2px solid #0f172a;
  height: 6px;
  min-width: 60px;
}

.scalebar-text {
  font-weight: 700;
  color: #0f172a;
}

.coordinates-indicator {
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-block;
  align-self: flex-start;
}

/* Bottom Right (Overview map & Watermark) */
.map-bottom-right {
  position: absolute;
  bottom: 10px;
  right: 375px;
  z-index: 500;
  display: flex;
  align-items: flex-end;
  gap: 10px;
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-closed .map-bottom-right {
  right: 14px;
}

.overview-toggle-btn {
  width: 30px;
  height: 30px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-standard);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #334155;
  transition: all var(--transition-fast);
}

.overview-toggle-btn:hover {
  background: #ffffff;
  color: var(--accent-blue);
}

.overview-box {
  width: 180px;
  height: 140px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-elevated);
  display: none;
  position: relative;
  overflow: hidden;
}

#overview-map {
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Sidebars and Floating Cards
   ========================================================================== */
.floating-card {
  position: absolute;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  border: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 600;
  display: none;
  animation: cardFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.card-header {
  padding: 10px 14px;
  background-color: var(--panel-header-bg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.card-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 3px;
  border-radius: 4px;
  display: flex;
}

.card-close-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.card-close-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Basemap Gallery Card */
#basemap-card {
  top: 60px;
  left: 56px;
  width: 330px;
  max-height: 440px;
}

.basemap-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 12px;
  max-height: 380px;
  overflow-y: auto;
}

.basemap-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 6px;
  border: 2px solid #e2e8f0;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-align: center;
  transition: all var(--transition-fast);
  background: #ffffff;
}

.basemap-item:hover {
  border-color: #94a3b8;
  transform: translateY(-2px);
  box-shadow: var(--shadow-standard);
}

.basemap-item.active {
  border-color: var(--accent-blue);
  background-color: #f0f9ff;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.2);
}

.basemap-thumb {
  width: 100%;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  margin-bottom: 6px;
  border: 1px solid #e2e8f0;
}

.basemap-label {
  font-size: 11px;
  font-weight: 600;
  color: #1e293b;
}

.basemap-item { position: relative; }

.basemap-badge {
  position: absolute;
  top: 9px;
  left: 9px;
  z-index: 1;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent-blue, #0284c7);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  pointer-events: none;
}

/* Shell-style well symbols (DOM SVG in wellsPane). --ws scales with zoom tier. */
.well-marker-wrap,
.well-symbol {
  background: none;
  border: none;
  cursor: pointer;
}
.well-marker-wrap .well-symbol-glyph,
.well-symbol svg {
  display: block;
  width: 14px;
  height: 14px;
  overflow: visible;
  transform: scale(var(--ws, 1));
  transition: transform 0.12s ease-out;
  cursor: pointer;
  pointer-events: auto;
}
.well-marker-wrap:hover .well-symbol-glyph,
.well-symbol:hover svg {
  transform: scale(calc(var(--ws, 1) * 1.35));
}
.zoom-tier-low .well-marker-wrap,
.zoom-tier-low .well-symbol { --ws: 0.72; }
.zoom-tier-mid .well-marker-wrap,
.zoom-tier-mid .well-symbol { --ws: 0.88; }
.zoom-tier-high .well-marker-wrap,
.zoom-tier-high .well-symbol { --ws: 1.0; }

/* Well Name Label: shown when zoomed in without clutter */
.well-name-label {
  display: none;
  position: absolute;
  left: 17px;
  top: -5px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 12px;
  color: #0f172a;
  white-space: nowrap;
  pointer-events: auto;
  cursor: pointer;
  text-shadow:
    -1px -1px 0 #ffffff,
     1px -1px 0 #ffffff,
    -1px  1px 0 #ffffff,
     1px  1px 0 #ffffff,
     0px -1px 0 #ffffff,
     0px  1px 0 #ffffff,
    -1px  0px 0 #ffffff,
     1px  0px 0 #ffffff,
     0 0 3px #ffffff,
     0 0 4px #ffffff;
  transition: opacity 0.15s ease-out;
  z-index: 10;
}

.well-marker-wrap.has-visible-label .well-name-label {
  display: block;
}

/* Hovering over any well symbol or label brings it to top with a subtle badge */
.well-marker-wrap:hover {
  z-index: 9999 !important;
}
.well-marker-wrap:hover .well-name-label {
  display: block !important;
  background: rgba(255, 255, 255, 0.95);
  padding: 1px 5px;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.25);
  border: 1px solid rgba(148, 163, 184, 0.4);
  text-shadow: none;
  color: #0284c7;
}

/* Legend / layer-list well symbol swatches */
.well-swatch {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  vertical-align: middle;
}

/* Measurement Card */
#measure-card {
  top: 60px;
  left: 56px;
  width: 300px;
}

.measure-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background: #f8fafc;
}

.measure-tab {
  flex: 1;
  padding: 9px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #64748b;
  transition: all var(--transition-fast);
}

.measure-tab.active {
  background: #ffffff;
  border-bottom-color: var(--accent-blue);
  color: var(--accent-blue);
}

.measure-body {
  padding: 14px;
}

.measure-instruction {
  font-size: 11px;
  color: #64748b;
  margin-bottom: 10px;
}

.measure-result-box {
  background: #f0f9ff;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  padding: 10px;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 700;
  color: #0369a1;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.measure-clear-btn {
  width: 100%;
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: #64748b;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color var(--transition-fast);
}

.measure-clear-btn:hover {
  background: #475569;
}

/* Bookmarks Card */
#bookmarks-card {
  top: 60px;
  left: 56px;
  width: 270px;
}

.bookmarks-list {
  padding: 6px 0;
  max-height: 300px;
  overflow-y: auto;
}

.bookmark-item {
  padding: 9px 14px;
  font-size: 12px;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition: all var(--transition-fast);
}

.bookmark-item:hover {
  background-color: #f0f9ff;
  color: var(--accent-blue);
  padding-left: 18px;
}

.bookmark-item svg {
  width: 15px;
  height: 15px;
  fill: #94a3b8;
}

/* ==========================================================================
   Layers Sidebar (Right Drawer) - Matches Screenshot 2 with High Polish
   ========================================================================== */
#layers-sidebar {
  position: absolute;
  top: 52px;
  right: 0;
  bottom: 0;
  width: 360px;
  background-color: #ffffff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
  z-index: 700;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-left: 1px solid #e2e8f0;
}

#layers-sidebar.hidden {
  transform: translateX(100%);
}

.sidebar-header {
  height: 48px;
  background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
}

.sidebar-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.sidebar-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-action-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
  color: #e2e8f0;
  cursor: pointer;
  padding: 5px;
  display: flex;
  transition: all var(--transition-fast);
}

.sidebar-action-btn:hover {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.sidebar-action-btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}

/* Layer filter search */
.layer-filter-bar {
  padding: 10px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  gap: 8px;
}

.layer-filter-input {
  flex: 1;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  outline: none;
  background: #ffffff;
  transition: border-color var(--transition-fast);
}

.layer-filter-input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

/* Layer Accordion Sections */
.layers-scroll-container {
  flex: 1;
  overflow-y: auto;
}

.layer-section {
  border-bottom: 1px solid #e2e8f0;
}

.section-header {
  background-color: #f1f5f9;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  transition: background-color var(--transition-fast);
  border-top: 1px solid #ffffff;
}

.section-header:hover {
  background-color: #e2e8f0;
}

.section-header-title {
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.section-chevron {
  width: 15px;
  height: 15px;
  fill: #64748b;
  transition: transform var(--transition-fast);
}

.section-header.collapsed .section-chevron {
  transform: rotate(-90deg);
}

.section-body {
  display: block;
}

.section-body.collapsed {
  display: none;
}

/* Individual Layer Row */
.layer-row {
  display: flex;
  flex-direction: column;
  border-bottom: 1px solid #f8fafc;
  padding: 5px 8px 5px 12px;
  transition: background-color var(--transition-fast);
}

.layer-row:hover {
  background-color: #f8fafc;
}

.layer-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  gap: 8px;
}

.layer-left-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  overflow: hidden;
}

.layer-toggle-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #94a3b8;
  display: flex;
  transition: color var(--transition-fast);
}

.layer-toggle-btn:hover {
  color: #334155;
}

.layer-toggle-btn svg {
  width: 13px;
  height: 13px;
  fill: currentColor;
  transition: transform var(--transition-fast);
}

.layer-toggle-btn.collapsed svg {
  transform: rotate(-90deg);
}

.layer-checkbox {
  cursor: pointer;
  width: 16px;
  height: 16px;
  accent-color: #0284c7;
}

.layer-label {
  font-size: 12px;
  font-weight: 500;
  color: #334155;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
}

.layer-right-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.layer-menu-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex;
}

.layer-menu-btn:hover {
  background-color: #e2e8f0;
  color: #1e293b;
}

.layer-menu-btn svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* Layer Legend preview inside row */
.layer-legend-drawer {
  padding: 6px 0 8px 32px;
  font-size: 11px;
  color: #475569;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.layer-legend-drawer.collapsed {
  display: none;
}

.legend-swatch-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.swatch-symbol {
  width: 18px;
  height: 13px;
  border-radius: 2px;
  border: 1px solid #64748b;
  flex-shrink: 0;
}

.swatch-circle {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

.swatch-icon {
  width: 16px;
  height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.swatch-line {
  width: 22px;
  height: 0;
  border-top: 3px solid;
  flex-shrink: 0;
}

/* Layer Opacity Slider & Menu Dropdown */
.layer-options-panel {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-md);
  padding: 8px 12px;
  margin: 4px 0 8px 28px;
  font-size: 11px;
  display: none;
}

.opacity-slider-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.opacity-slider {
  flex: 1;
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.layer-option-link {
  color: var(--accent-blue);
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
  font-weight: 600;
  font-size: 11px;
}

.layer-option-link:hover {
  text-decoration: underline;
}

/* ==========================================================================
   Legend Floating Panel
   ========================================================================== */
#legend-panel {
  position: absolute;
  top: 66px;
  right: 375px;
  width: 300px;
  max-height: 500px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-elevated);
  border: 1px solid rgba(0, 0, 0, 0.08);
  z-index: 650;
  display: none;
  overflow: hidden;
  transition: right 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

body.sidebar-closed #legend-panel {
  right: 14px;
}

.legend-body {
  padding: 12px 16px;
  max-height: 450px;
  overflow-y: auto;
}

.legend-group-title {
  font-size: 12px;
  font-weight: 700;
  color: #0f172a;
  margin: 12px 0 6px 0;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.legend-group-title:first-child {
  margin-top: 0;
}

/* ==========================================================================
   Attribute Table Bottom Drawer
   ========================================================================== */
#attribute-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 290px;
  background: #ffffff;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  z-index: 800;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border-top: 1px solid #cbd5e1;
}

#attribute-drawer.hidden {
  transform: translateY(100%);
}

.drawer-header {
  height: 40px;
  background-color: #f1f5f9;
  border-bottom: 1px solid #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  user-select: none;
}

.drawer-tabs {
  display: flex;
  gap: 2px;
  height: 100%;
  overflow-x: auto;
}

.drawer-tab {
  height: 40px;
  padding: 0 16px;
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition-fast);
}

.drawer-tab:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.drawer-tab.active {
  background-color: #ffffff;
  border-bottom-color: var(--accent-blue);
  color: var(--accent-blue);
}

.drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.table-filter-input {
  padding: 5px 10px;
  font-size: 11px;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  width: 160px;
}

.drawer-btn {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 10px;
  cursor: pointer;
  color: #334155;
  transition: all var(--transition-fast);
}

.drawer-btn:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: #64748b;
  padding: 4px;
}

.drawer-close-btn:hover {
  color: #0f172a;
}

.table-container {
  flex: 1;
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  text-align: left;
}

.data-table th {
  position: sticky;
  top: 0;
  background-color: #f1f5f9;
  color: #0f172a;
  padding: 8px 12px;
  font-weight: 700;
  border-right: 1px solid #e2e8f0;
  border-bottom: 2px solid #cbd5e1;
  cursor: pointer;
  white-space: nowrap;
}

.data-table th:hover {
  background-color: #e2e8f0;
}

.data-table td {
  padding: 6px 12px;
  border-bottom: 1px solid #f1f5f9;
  border-right: 1px solid #f8fafc;
  white-space: nowrap;
  color: #334155;
}

.data-table tr:nth-child(even) {
  background-color: #f8fafc;
}

.data-table tr:hover {
  background-color: #f0f9ff;
  cursor: pointer;
}

.data-table tr.selected {
  background-color: #e0f2fe !important;
}

/* ==========================================================================
   Modals (Splash Screen, Documents Catalog, PDF Viewer)
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(6px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.hidden {
  display: none;
}

/* Splash Card Modal - Presidential Polish */
#splash-modal .modal-card {
  width: 100%;
  max-width: 640px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: 32px 36px 24px 36px;
  position: relative;
  display: flex;
  flex-direction: column;
  animation: modalFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(0, 0, 0, 0.08);
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.splash-header-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid #f1f5f9;
}

.splash-emblem {
  height: 64px;
  width: 64px;
  object-fit: contain;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.splash-ronda-logo {
  height: 48px;
  width: auto;
  object-fit: contain;
}

.splash-perceptum-logo {
  height: 28px;
  width: auto;
  object-fit: contain;
  padding: 2px 6px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
}

.splash-country-header {
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #64748b;
  margin-bottom: 6px;
}

.splash-title {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 18px;
  line-height: 1.3;
  text-align: center;
}

.splash-body {
  font-size: 13.5px;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 26px;
}

.splash-body p {
  margin-bottom: 12px;
}

.splash-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #e2e8f0;
  padding-top: 18px;
}

.splash-checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  user-select: none;
}

.splash-ok-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  padding: 9px 28px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.4);
  transition: all var(--transition-fast);
}

.splash-ok-btn:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.5);
}

/* Documents / Licensing Round Catalog Modal */
#docs-modal .modal-card {
  width: 92%;
  max-width: 960px;
  max-height: 88vh;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.docs-modal-header {
  padding: 14px 18px;
  background: linear-gradient(135deg, #0b1528 0%, #172a45 100%);
  color: #ffffff;
  border-bottom: 2px solid #0284c7;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.docs-header-branding {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.docs-header-emblem {
  width: 38px;
  height: 38px;
  object-fit: contain;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  flex-shrink: 0;
}

.docs-modal-title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #ffffff;
  line-height: 1.3;
}

.docs-modal-subtitle {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 1px;
}

.docs-toolbar {
  padding: 12px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.docs-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #e2e8f0;
  padding: 3px;
  border-radius: 8px;
}

.docs-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  background: transparent;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.docs-tab:hover {
  color: #0f172a;
}

.docs-tab.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.docs-tab.docs-tab-summaries.active {
  color: #0284c7;
}

.docs-tab-count {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(148, 163, 184, 0.2);
  color: inherit;
  border-radius: 10px;
}

.docs-tab.active .docs-tab-count {
  background: #e0f2fe;
  color: #0284c7;
}

.docs-search-wrap {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 320px;
}

.docs-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: #94a3b8;
  pointer-events: none;
}

.docs-search-input {
  width: 100%;
  padding: 6px 12px 6px 32px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #ffffff;
  color: #0f172a;
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.docs-search-input:focus {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.15);
}

.docs-grid {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  overflow-y: auto;
  max-height: calc(88vh - 145px);
}

.doc-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
}

.doc-card:hover {
  border-color: #0284c7;
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.12);
  transform: translateY(-2px);
}

.doc-card.is-summary {
  border-left: 4px solid #0284c7;
}

.doc-card.is-report {
  border-left: 4px solid #475569;
}

.doc-card-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.doc-block-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  background: #e0f2fe;
  color: #0369a1;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.doc-category-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  padding: 2px 7px;
  border-radius: 4px;
}

.badge-available-summary {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
}

.badge-prospectivity-report {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.doc-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 6px;
  line-height: 1.35;
}

.doc-desc {
  font-size: 11.5px;
  color: #64748b;
  line-height: 1.4;
  margin-bottom: 14px;
  flex: 1;
}

.doc-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  color: #94a3b8;
  margin-bottom: 12px;
}

.doc-meta svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.doc-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid #f1f5f9;
}

.doc-btn {
  padding: 7px 12px;
  font-size: 11.5px;
  font-weight: 600;
  text-align: center;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--transition-fast);
  border: none;
}

.doc-btn-view {
  flex: 2;
  background-color: #0284c7;
  color: #ffffff;
}

.doc-btn-view:hover {
  background-color: #0369a1;
}

.doc-btn-locate {
  flex: 1;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.doc-btn-locate:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.doc-btn-ext {
  padding: 7px 8px;
  background-color: #f8fafc;
  color: #64748b;
  border: 1px solid #e2e8f0;
}

.doc-btn-ext:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.doc-contact-notice {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
}

.doc-contact-notice svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  fill: #0284c7;
}

.card-action-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: #0284c7;
  text-decoration: none;
  padding: 4px 10px;
  background: #e0f2fe;
  border-radius: 5px;
  transition: all var(--transition-fast);
}

.card-action-link:hover {
  background: #bae6fd;
  color: #0369a1;
}

/* PDF Viewer Modal */
#pdf-modal .modal-card {
  width: 94%;
  height: 90vh;
  max-width: 1250px;
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-viewer-frame {
  flex: 1;
  width: 100%;
  border: none;
  background: #334155;
}

/* ==========================================================================
   Leaflet Custom Popups
   ========================================================================== */
.leaflet-popup-content-wrapper {
  padding: 0 !important;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.35) !important;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
}

.leaflet-popup-content {
  margin: 0 !important;
  width: 325px !important;
  font-family: inherit !important;
  font-size: 12px !important;
  color: #1e293b !important;
  line-height: 1.4 !important;
}

.popup-banner-container {
  width: 100%;
  height: 85px;
  overflow: hidden;
  background: #1e293b;
  position: relative;
}

.popup-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.popup-title-bar {
  padding: 9px 14px;
  background-color: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.popup-body-content {
  padding: 12px 14px;
  max-height: 270px;
  overflow-y: auto;
}

.popup-table {
  width: 100%;
  border-collapse: collapse;
}

.popup-table td {
  padding: 5px 0;
  vertical-align: top;
}

.popup-table .field-label {
  font-weight: 600;
  color: #64748b;
  width: 38%;
}

.popup-table .field-value {
  color: #0f172a;
  font-weight: 500;
}

.popup-footer-actions {
  padding: 10px 14px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.popup-btn {
  flex: 1 1 calc(50% - 4px);
  min-width: 100px;
  padding: 7px 10px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all var(--transition-fast);
}

.popup-btn-summary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(2, 132, 199, 0.25);
}

.popup-btn-summary:hover {
  background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
  box-shadow: 0 2px 4px rgba(2, 132, 199, 0.4);
}

.popup-btn-pdf {
  background-color: #dc2626;
  color: #ffffff;
}

.popup-btn-pdf:hover {
  background-color: #b91c1c;
}

/* No prospectivity document for this block */
.popup-btn-pdf.is-disabled,
.popup-btn-pdf.is-disabled:hover {
  background-color: #e2e8f0 !important;
  color: #94a3b8 !important;
  cursor: not-allowed;
}

.popup-btn-zoom {
  background-color: #334155;
  color: #ffffff;
}

.popup-btn-zoom:hover {
  background-color: #1e293b;
}

.popup-btn-portfolio {
  background-color: #059669;
  color: #ffffff;
}

.popup-btn-portfolio:hover {
  background-color: #047857;
}

.popup-doc-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1.3;
}

.popup-doc-tag.tag-summary {
  background: #e0f2fe;
  color: #0284c7;
  border: 1px solid #bae6fd;
}

.popup-doc-tag.tag-report {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.popup-age-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-block;
}

.popup-age-badge.age-tertiary {
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.popup-age-badge.age-cretaceous {
  background: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Pulsating Radar Effect for Punta Europa LNG */
@keyframes radarPing {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* Block Labels & Feature Tooltips on Map */
.block-text-label {
  pointer-events: none;
  width: 0 !important;
  height: 0 !important;
  overflow: visible;
}

.block-text-label span {
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -50%);
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.78);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  white-space: nowrap;
  transition: opacity 0.18s ease;
}

/* Zoomed out: small, quiet labels so the national overview stays readable */
.zoom-tier-low .block-text-label span {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: rgba(15, 23, 42, 0.62);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.zoom-tier-high .block-text-label span {
  font-size: 12px;
  padding: 3px 8px;
}

/* Labels suppressed by the collision engine */
.block-text-label.label-hidden span {
  opacity: 0;
  visibility: hidden;
}

.legend-hint {
  font-size: 10.5px;
  font-style: italic;
  color: #64748b;
  margin: 2px 0 6px 2px;
}

.block-map-tooltip,
.well-map-tooltip,
.prospect-map-tooltip {
  background: rgba(15, 23, 42, 0.92) !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 6px !important;
  padding: 6px 10px !important;
  font-family: var(--font-sans) !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45) !important;
}

.block-map-tooltip::before,
.well-map-tooltip::before,
.prospect-map-tooltip::before {
  border-top-color: rgba(15, 23, 42, 0.92) !important;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  #kpi-s2d, #kpi-docs {
    display: none;
  }
}

@media (max-width: 900px) {
  .map-kpi-bar {
    display: none;
  }
}

@media (max-width: 768px) {
  .brand-subtitle, .partner-badge-header {
    display: none;
  }
  .search-widget {
    width: 220px;
  }
  #layers-sidebar {
    width: 100%;
  }
  #legend-panel {
    right: 14px;
    width: 90%;
  }
}


/* ==========================================================================
   Map performance: controls floating over the map are 85-98% opaque, so a
   backdrop blur is visually negligible but forces the browser to re-blur the
   map underneath on every pan/zoom frame. Disable it for map overlays.
   ========================================================================== */
.leaflet-control-zoom,
.map-kpi-bar,
.search-widget,
.map-vertical-toolbar,
.scalebar-container,
.coordinates-indicator,
.overview-toggle-btn,
.floating-card,
#legend-panel {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

.map-kpi-bar {
  background: rgba(15, 23, 42, 0.93);
}

/* Promote the vector canvas to its own compositor layer for smoother panning */
.leaflet-overlay-pane canvas {
  will-change: transform;
}

/* ==========================================================================
   PROFESSIONAL POLISH LAYER
   Unified typography, colour, elevation and control styling. Appended last so
   it refines the components above without changing their layout/positions.
   ========================================================================== */
:root {
  --ui-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ink-900: #0b1220;
  --ink-800: #111a2b;
  --ink-700: #1c2740;
  --ink-500: #475569;
  --ink-400: #64748b;
  --ink-300: #94a3b8;
  --line: #e5e9f0;
  --line-soft: #eef1f6;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --brand: #0b6fb8;
  --brand-600: #0a5f9e;
  --brand-50: #eaf4fb;
  --gold: #e3a21a;
  --radius-ui: 10px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-2: 0 4px 12px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-3: 0 12px 32px rgba(15, 23, 42, 0.16), 0 2px 6px rgba(15, 23, 42, 0.08);
}

html, body,
button, input, select, textarea,
.leaflet-container,
.leaflet-tooltip,
.leaflet-popup-content {
  font-family: var(--ui-font);
  font-feature-settings: "cv11", "ss01";
}

body { letter-spacing: -0.005em; }

/* ---------- Header ---------- */
#header-bar {
  background: linear-gradient(180deg, #0f1a2c 0%, #0b1424 100%);
  border-bottom: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04), 0 4px 14px rgba(0, 0, 0, 0.28);
}
/* Thin brand accent line under the header */
#header-bar::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: linear-gradient(90deg, #3e9a3b 0%, #3e9a3b 33%, #f5f5f5 33%, #f5f5f5 66%, #d52b1e 66%, #d52b1e 100%);
  opacity: 0.85;
  pointer-events: none;
}
.brand-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; }
.brand-subtitle { color: #8a9bb4; font-size: 11px; letter-spacing: 0.01em; }
.brand-tag {
  background: rgba(227, 162, 26, 0.14);
  color: #f3c058;
  border: 1px solid rgba(227, 162, 26, 0.45);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  padding: 1px 7px;
}
.brand-divider { background: rgba(255, 255, 255, 0.10); }
.logo-badge { border-radius: 8px; box-shadow: none; }
.logo-badge:hover, .header-btn:hover { transform: none; }

.partner-badge-header {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.10);
  color: #8a9bb4;
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
.partner-logo-img { border-radius: 3px; }

.header-tools { gap: 2px; }
.header-btn {
  height: 34px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #c3cede;
  font-weight: 550;
  letter-spacing: 0.005em;
}
.header-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.06);
  color: #fff;
}
.header-btn.active {
  background: rgba(56, 160, 230, 0.16);
  border-color: rgba(56, 160, 230, 0.40);
  color: #fff;
  box-shadow: none;
}
.header-btn.active svg { fill: #6cc0f5; }

/* ---------- KPI bar ---------- */
.map-kpi-bar {
  background: rgba(11, 18, 32, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow-2);
  padding: 4px 8px;
  gap: 2px;
}
.kpi-chip {
  font-size: 11px;
  font-weight: 500;
  color: #aebbd0;
  padding: 4px 9px;
  letter-spacing: 0.01em;
}
.kpi-chip .kpi-num {
  color: #ffffff;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.kpi-chip:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.kpi-dot { background: rgba(255, 255, 255, 0.18); }

/* ---------- Search & vertical toolbar ---------- */
.search-widget {
  border-radius: var(--radius-ui);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: var(--shadow-2);
}
.search-widget:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(11, 111, 184, 0.16), var(--shadow-2);
}
.search-input { font-size: 13px; color: var(--ink-800); }
.search-input::placeholder { color: #9aa7b8; }
.search-btn { background: var(--surface-2); border-left-color: var(--line); }

.map-vertical-toolbar {
  border-radius: var(--radius-ui) !important;
  box-shadow: var(--shadow-2) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}
.toolbar-btn { color: #334155; transition: background-color .15s, color .15s; }
.toolbar-btn:hover { background: var(--brand-50); color: var(--brand); }
.toolbar-btn.active { background: var(--brand); color: #fff; }
.toolbar-divider { background: var(--line) !important; }

/* ---------- Floating cards / legend / modals ---------- */
.floating-card,
#legend-panel {
  border-radius: 12px !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: var(--shadow-3) !important;
  overflow: hidden;
}
.card-header {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--line) !important;
  color: var(--ink-800) !important;
  font-size: 13px !important;
  font-weight: 650 !important;
  letter-spacing: -0.005em;
}
.card-close-btn {
  border-radius: 6px;
  color: var(--ink-400);
  transition: background-color .15s, color .15s;
}
.card-close-btn:hover { background: #f1f4f8; color: var(--ink-800); }

.legend-group-title {
  font-size: 10.5px !important;
  font-weight: 650 !important;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-400) !important;
  margin-top: 12px;
  margin-bottom: 6px;
}
.legend-body > div:first-child .legend-group-title { margin-top: 2px; }
.legend-swatch-item { font-size: 12px; color: #334155; gap: 9px; padding: 2px 0; }
.legend-hint { color: var(--ink-300); font-style: italic; font-size: 11px; }

.modal-overlay { background: rgba(8, 13, 24, 0.62) !important; }
.modal-card {
  border-radius: 16px !important;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- Layers sidebar ---------- */
#layers-sidebar {
  border-left: 1px solid var(--line) !important;
  box-shadow: -8px 0 24px rgba(15, 23, 42, 0.08) !important;
}
.sidebar-header {
  background: var(--surface) !important;
  border-bottom: 1px solid var(--line) !important;
}
.sidebar-title { font-size: 14px; font-weight: 650; color: var(--ink-800); letter-spacing: -0.01em; }
.sidebar-action-btn { border-radius: 6px; color: var(--ink-400); }
.sidebar-action-btn:hover { background: #f1f4f8; color: var(--ink-800); }
.layer-filter-bar { background: var(--surface) !important; border-bottom: 1px solid var(--line-soft) !important; }
.layer-filter-input {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: var(--surface-2) !important;
  font-size: 12.5px;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.layer-filter-input:focus {
  outline: none;
  background: #fff !important;
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 3px rgba(11, 111, 184, 0.14);
}
.section-header {
  background: var(--surface-2) !important;
  border-bottom: 1px solid var(--line-soft) !important;
  font-size: 11px !important;
  font-weight: 650 !important;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-500) !important;
}
.section-header:hover { background: #f0f4f9 !important; }
.layer-row { border-bottom: 1px solid var(--line-soft) !important; transition: background-color .12s; }
.layer-row:hover { background: #f8fafd; }
.layer-label { font-size: 12.5px; color: #1f2a3d; font-weight: 500; }
.layer-checkbox,
.splash-checkbox-wrap input { accent-color: var(--brand); }
.layer-legend-drawer { background: #fbfcfe; }
.opacity-slider { accent-color: var(--brand); }

/* ---------- Attribute table drawer ---------- */
#attribute-drawer { box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.12) !important; border-top: 1px solid var(--line) !important; }
.drawer-header { background: var(--surface) !important; border-bottom: 1px solid var(--line) !important; }
.drawer-tab { font-weight: 550; color: var(--ink-400); }
.drawer-tab.active { color: var(--brand) !important; box-shadow: inset 0 -2px 0 var(--brand); }
.drawer-btn { background: var(--brand) !important; border-color: var(--brand) !important; border-radius: 7px !important; }
.drawer-btn:hover { background: var(--brand-600) !important; }
.table-container table { font-variant-numeric: tabular-nums; }
.table-container th {
  background: var(--surface-2) !important;
  color: var(--ink-500) !important;
  font-size: 10.5px !important;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 650 !important;
}
.table-container tr:hover td { background: var(--brand-50) !important; }

/* ---------- Leaflet popups ---------- */
.leaflet-popup-content-wrapper {
  border-radius: 12px !important;
  box-shadow: var(--shadow-3) !important;
  padding: 0 !important;
  overflow: hidden;
}
.leaflet-popup-content { margin: 0 !important; font-size: 12.5px; line-height: 1.45; }
.leaflet-popup-tip { box-shadow: none !important; }
.leaflet-container a.leaflet-popup-close-button { color: rgba(255, 255, 255, 0.85); top: 6px; right: 6px; }
.popup-title-bar { font-weight: 650 !important; letter-spacing: -0.005em; }
.popup-table td { padding-top: 5px !important; padding-bottom: 5px !important; border-bottom: 1px solid var(--line-soft) !important; }
.popup-table tr:last-child td { border-bottom: none !important; }
.field-label { color: var(--ink-400) !important; font-weight: 500 !important; }
.field-value { color: var(--ink-800) !important; }

/* ---------- Map tooltips ---------- */
.block-map-tooltip,
.well-map-tooltip,
.prospect-map-tooltip {
  background: rgba(11, 18, 32, 0.94) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  box-shadow: var(--shadow-2) !important;
  font-size: 12px !important;
  padding: 6px 9px !important;
}

/* ---------- Bottom-left scale / coordinates, attribution ---------- */
.scalebar-container,
.coordinates-indicator {
  background: rgba(11, 18, 32, 0.80) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 7px !important;
  box-shadow: var(--shadow-1) !important;
  font-variant-numeric: tabular-nums;
  font-size: 11px !important;
  letter-spacing: 0.01em;
}
.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.72) !important;
  color: #5b6779 !important;
  font-size: 10px !important;
  border-radius: 6px 0 0 0;
  padding: 1px 6px !important;
}
.leaflet-control-attribution a { color: var(--brand) !important; }

/* ---------- Splash ---------- */
.splash-title { letter-spacing: -0.015em; font-weight: 700 !important; }
.splash-country-header { letter-spacing: 0.06em; text-transform: uppercase; font-size: 11px !important; }
.splash-ok-btn {
  background: var(--brand) !important;
  border-radius: 9px !important;
  font-weight: 600 !important;
  box-shadow: 0 6px 16px rgba(11, 111, 184, 0.30) !important;
  transition: background-color .15s, transform .15s;
}
.splash-ok-btn:hover { background: var(--brand-600) !important; transform: translateY(-1px); }

/* ---------- Basemap gallery ---------- */
.basemap-item { border-width: 1px !important; border-radius: 10px !important; }
.basemap-item:hover { transform: none !important; border-color: #b8c4d4 !important; }
.basemap-item.active { border-color: var(--brand) !important; box-shadow: 0 0 0 2px rgba(11, 111, 184, 0.22) !important; }
.basemap-thumb { border-radius: 7px !important; border: none !important; }

/* ---------- Scrollbars & focus ---------- */
* { scrollbar-width: thin; scrollbar-color: #c8d1dd transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #c8d1dd; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background-color: #aab6c6; }
*::-webkit-scrollbar-track { background: transparent; }

button:focus-visible,
a:focus-visible,
input:focus-visible,
.kpi-chip:focus-visible {
  outline: 2px solid #4aa8e8;
  outline-offset: 2px;
}

/* Block labels: crisper, consistent with UI type */
.block-label { font-family: var(--ui-font) !important; letter-spacing: 0.02em; }

/* Polish fixes: readable scale bar, legend group spacing, compact survey rows,
   attribution kept clear of the layers sidebar */
.scalebar-text { color: #e6edf6 !important; font-weight: 550; }
.scalebar-line { border-color: #e6edf6 !important; }
.legend-body > div + div .legend-group-title {
  margin-top: 16px !important;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.layer-row:has(.survey-checkbox) { border-bottom-color: transparent !important; }
.layer-row:has(.survey-checkbox) .layer-row-main { padding-top: 3px !important; padding-bottom: 3px !important; min-height: 0 !important; }
.layer-row:has(.survey-checkbox) .layer-label { font-size: 12px; color: var(--ink-500); font-weight: 450; }
body.sidebar-open:not(.sidebar-closed) .leaflet-bottom.leaflet-right { right: 360px; transition: right 0.25s; }

/* Search: the widget used overflow:hidden, which clipped the suggestions list
   (positioned below it) so results were invisible. Let it overflow and keep the
   rounded corners on the inner parts instead. */
.search-widget { overflow: visible !important; }
.search-input-wrapper { border-radius: var(--radius-ui) 0 0 var(--radius-ui); }
.search-btn { border-radius: 0 var(--radius-ui) var(--radius-ui) 0; cursor: pointer; }
.search-btn:hover { background: var(--brand-50); }
.search-btn svg { fill: var(--ink-500); }
.search-suggestions {
  top: calc(100% + 6px) !important;
  z-index: 1200 !important;
  max-height: 360px !important;
  border-radius: var(--radius-ui) !important;
  box-shadow: var(--shadow-3) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  padding: 4px 0;
}
.search-suggestion-item { gap: 10px; padding: 8px 12px !important; border-bottom: none !important; }
.search-suggestion-item.active,
.search-suggestion-item:hover { background: var(--brand-50) !important; }
.suggestion-text { display: flex; flex-direction: column; min-width: 0; }
.suggestion-name { color: var(--ink-800) !important; font-weight: 600; font-size: 12.5px; }
.suggestion-detail { color: var(--ink-400); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggestion-type {
  flex: 0 0 auto;
  font-size: 9.5px !important;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: 999px;
  background: #eef2f7;
  color: var(--ink-500) !important;
}
.suggestion-type.type-block { background: #e0f2fe; color: #0369a1 !important; }
.suggestion-type.type-well { background: #f1f5f9; color: #111827 !important; }
.suggestion-type.type-field { background: #ffedd5; color: #c2410c !important; }
.suggestion-type.type-prospect { background: #fef3c7; color: #b45309 !important; }
.search-no-results { padding: 10px 12px; font-size: 12px; color: var(--ink-300); }

/* Longer MHME subtitle: truncate gracefully on narrow screens */
.brand-titles { min-width: 0; }
.brand-subtitle { overflow: hidden; text-overflow: ellipsis; max-width: 48vw; display: block; }

/* ==========================================================================
   Island & place names (context labels)
   ========================================================================== */
.place-label { pointer-events: none; }
.place-label span {
  position: absolute;
  white-space: nowrap;
  font-family: var(--ui-font, 'Inter', system-ui, sans-serif);
  color: #0f172a;
  line-height: 1;
  text-shadow: 0 0 3px #fff, 0 0 3px #fff, 1px 1px 0 #fff, -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff;
}
.place-dot {
  position: absolute;
  width: 6px; height: 6px;
  margin: -3px 0 0 -3px;
  border-radius: 50%;
  background: #0f172a;
  box-shadow: 0 0 0 1.5px #fff;
}
/* Large land areas: spaced capitals centred on the land mass */
.place-area span {
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: #334155;
}
.zoom-tier-low .place-area span { font-size: 11px; letter-spacing: 0.14em; }
/* Islands: italic, beside their dot */
.place-island span, .place-minor span { font-style: italic; font-weight: 600; font-size: 12px; }
.place-minor span { font-size: 11px; font-weight: 500; }
.place-city span { font-size: 11px; font-weight: 600; color: #1e293b; }
.place-city .place-dot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; border-radius: 1px; }
/* Label side relative to the dot */
.place-pos-right span       { left: 7px;  top: 0;   transform: translateY(-50%); }
.place-pos-left span        { right: 7px; top: 0;   transform: translateY(-50%); }
.place-pos-below-right span { left: 6px;  top: 3px; }
.place-pos-above-right span { left: 6px;  bottom: 4px; }
/* Small islands and towns only once zoomed in enough to separate them */
.place-minor, .place-city { display: none; }
.zoom-ge-8 .place-minor, .zoom-ge-8 .place-city { display: block; }
.place-pos-below span { left: 0; top: 6px; transform: translateX(-50%); }
.zoom-tier-low .place-hide-low { display: none; }

/* ==========================================================================
   Available blocks (12 offered in the licensing round) - subtle highlight
   ========================================================================== */
.block-text-label.is-available span {
  background: rgba(3, 105, 161, 0.88);
  border-color: rgba(125, 211, 252, 0.85);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.18), 0 1px 3px rgba(0, 0, 0, 0.3);
}
.zoom-tier-low .block-text-label.is-available span { background: rgba(3, 105, 161, 0.8); }
.popup-available-badge {
  margin: 8px 12px 0;
  padding: 5px 10px;
  border-radius: 6px;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  color: #0369a1;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.kpi-available .kpi-num { color: #7dd3fc !important; }
.kpi-available:hover .kpi-num { color: #bae6fd !important; }
