/* ===== ORIGINAL CSS (unchanged) ===== */

:root {
  --primary: #0066cc;
  --primary-dark: #004d99;
  --primary-light: #e6f0fa;
  --secondary: #00a651;
  --accent: #ff6b00;
  --text-primary: #1a1a2e;
  --text-secondary: #5a5a6e;
  --text-muted: #8a8a9a;
  --bg-white: #ffffff;
  --bg-light: #f8f9fc;
  --bg-dark: #0a1628;
  --border: #e2e4e9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.2s ease;
}

* { box-sizing: border-box; }

body {
  margin: 0; padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}

#map {
  position: absolute;
  top: 60px; bottom: 0;
  width: 100%;
  height: calc(100% - 60px);
}

#top-taskbar {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 60px;
  background: var(--bg-white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  z-index: 2000;
  box-shadow: var(--shadow-sm);
}

.taskbar-brand { display: flex; align-items: center; gap: 12px; }
.taskbar-brand img { height: 36px; width: 36px; }
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 18px; color: var(--primary); letter-spacing: -0.5px; }
.brand-tagline { font-size: 11px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }

.taskbar-nav { display: flex; gap: 4px; }
.nav-item {
  padding: 10px 18px; font-size: 14px; font-weight: 500;
  cursor: pointer; border-radius: var(--radius-sm);
  color: var(--text-secondary); transition: var(--transition);
  display: flex; align-items: center; gap: 8px;
}
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active { background: var(--primary); color: white; }
.nav-item.legal-link { font-size: 12px; padding: 8px 14px; }

.legal-modal {
  display: none;
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(10, 22, 40, 0.85);
  backdrop-filter: blur(4px);
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}
.legal-modal.active {
  display: flex; align-items: center;
  justify-content: center; padding: 20px;
}
.legal-content {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  max-width: 700px; width: 100%;
  max-height: 85vh;
  box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
.legal-header {
  padding: 24px 28px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.legal-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0; }
.legal-close {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm); border: none;
  background: var(--bg-light); color: var(--text-secondary);
  cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 20px; transition: var(--transition);
}
.legal-close:hover { background: var(--border); color: var(--text-primary); }
.legal-body { padding: 28px; overflow-y: auto; flex: 1; }
.legal-body h3 { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 24px 0 12px 0; }
.legal-body h3:first-child { margin-top: 0; }
.legal-body p { font-size: 14px; line-height: 1.7; color: var(--text-secondary); margin: 0 0 16px 0; }
.legal-body ul { margin: 0 0 16px 0; padding-left: 24px; }
.legal-body li { font-size: 14px; line-height: 1.7; color: var(--text-secondary); margin-bottom: 8px; }
.legal-body strong { color: var(--text-primary); font-weight: 600; }
.legal-body code { background: var(--bg-light); padding: 2px 6px; border-radius: 4px; font-family: 'Courier New', monospace; font-size: 13px; color: var(--primary); }

.nav-icon { width: 18px; height: 18px; opacity: 0.8; }
.taskbar-status { display: flex; align-items: center; gap: 16px; }
.status-indicator {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: var(--bg-light);
  border-radius: var(--radius-sm); font-size: 13px; color: var(--text-secondary);
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--secondary); animation: pulse-status 2s infinite;
}
@keyframes pulse-status {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

#menu {
  position: fixed; top: 72px; left: 12px;
  width: 340px; max-height: calc(100vh - 84px);
  background: var(--bg-white); z-index: 1500;
  border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  overflow: hidden; transition: transform 0.3s ease, opacity 0.3s ease;
  display: flex; flex-direction: column;
}
#menu.hidden { transform: translateX(-360px); opacity: 0; pointer-events: none; }

.panel-header { padding: 20px; border-bottom: 1px solid var(--border); background: var(--bg-light); }
.panel-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin: 0; }
.panel-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.panel-content { padding: 16px; overflow-y: auto; flex: 1; max-height: calc(100vh - 200px); }

#section-layers, #section-search, #section-account { display: none; }
.active-section { display: block !important; }

.layer-category { margin-bottom: 16px; }
.category-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; background: var(--bg-light);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: var(--transition); margin-bottom: 8px;
}
.category-header:hover { background: var(--primary-light); }
.category-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--primary); user-select: none; -webkit-user-select: none; }
.category-icon { width: 16px; height: 16px; transition: transform 0.2s ease; }
.category-content { padding-left: 4px; }

.layer-item {
  display: flex; align-items: center;
  padding: 10px 12px; border-radius: var(--radius-sm);
  cursor: pointer; transition: var(--transition); gap: 12px;
  user-select: none; -webkit-user-select: none;
}
.layer-item:hover { background: var(--bg-light); }
.layer-checkbox { width: 18px; height: 18px; border: 2px solid var(--border); border-radius: 4px; cursor: pointer; accent-color: var(--primary); }
.layer-checkbox:checked { border-color: var(--primary); }
.layer-label { font-size: 14px; color: var(--text-primary); flex: 1; user-select: none; -webkit-user-select: none; }
.layer-badge { font-size: 10px; padding: 3px 8px; border-radius: 10px; background: var(--bg-light); color: var(--text-muted); font-weight: 500; user-select: none; -webkit-user-select: none; }

.legend-box { background: var(--bg-light); border-radius: var(--radius-sm); padding: 12px; margin-top: 8px; margin-left: 30px; }
.legend-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; user-select: none; -webkit-user-select: none; }
.legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); user-select: none; -webkit-user-select: none; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(0,0,0,0.1); }

.search-container { display: flex; flex-direction: column; gap: 12px; }
.search-input-wrapper { position: relative; }
.search-input {
  width: 100%; padding: 14px 16px 14px 44px;
  border: 2px solid var(--border); border-radius: var(--radius-md);
  font-size: 14px; font-family: inherit; transition: var(--transition);
  background: var(--bg-white);
}
.search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.search-input::placeholder { color: var(--text-muted); }
.search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--text-muted); }
.search-actions { display: flex; gap: 8px; }
.btn { padding: 12px 20px; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; font-family: inherit; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 8px; }
.btn-primary { background: var(--primary); color: white; flex: 1; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--bg-light); color: var(--text-secondary); }
.btn-secondary:hover { background: var(--border); }
.search-hint { font-size: 12px; color: var(--text-muted); padding: 12px; background: var(--bg-light); border-radius: var(--radius-sm); line-height: 1.5; }
.search-hint strong { color: var(--text-secondary); }

.account-card { background: var(--bg-light); border-radius: var(--radius-md); padding: 20px; display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.account-avatar { width: 48px; height: 48px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 18px; }
.account-info { flex: 1; }
.account-name { font-weight: 600; font-size: 15px; color: var(--text-primary); }
.account-status { font-size: 13px; color: var(--text-muted); display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.account-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--secondary); }
.btn-logout { width: 100%; padding: 12px; background: transparent; border: 2px solid var(--border); color: var(--text-secondary); border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; transition: var(--transition); }
.btn-logout:hover { background: #fee; border-color: #fcc; color: #c00; }
#admin-dashboard-btn { background: var(--primary); color: white; border-color: var(--primary); }
#admin-dashboard-btn:hover { background: var(--primary-dark) !important; border-color: var(--primary-dark) !important; color: white !important; }

#login-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(135deg, #0a1628 0%, #1a2d4a 50%, #0a1628 100%);
  display: flex; justify-content: center; align-items: center; z-index: 9999;
}
.login-container { display: flex; flex-direction: column; align-items: center; gap: 32px; }
.login-branding { text-align: center; }
.login-branding img { width: 80px; height: 80px; margin-bottom: 16px; }
.login-branding h1 { color: white; font-size: 32px; font-weight: 700; margin: 0; letter-spacing: -0.5px; }
.login-branding p { color: rgba(255,255,255,0.6); font-size: 16px; margin: 8px 0 0 0; }
.login-box { background: var(--bg-white); padding: 40px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 400px; }
.login-header { text-align: center; margin-bottom: 32px; }
.login-header h2 { font-size: 24px; font-weight: 700; color: var(--text-primary); margin: 0 0 8px 0; }
.login-header p { font-size: 14px; color: var(--text-muted); margin: 0; }
.login-form { display: flex; flex-direction: column; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.form-input { padding: 14px 16px; border: 2px solid var(--border); border-radius: var(--radius-sm); font-size: 15px; font-family: inherit; transition: var(--transition); }
.form-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.btn-login { padding: 14px; background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); font-size: 16px; font-weight: 600; cursor: pointer; transition: var(--transition); margin-top: 8px; }
.btn-login:hover { background: var(--primary-dark); transform: translateY(-1px); }
#error-msg { color: #dc2626; font-size: 14px; text-align: center; min-height: 20px; margin-top: 8px; }
.auth-signup-section { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--border); text-align: center; }
.auth-signup-text { font-size: 14px; color: var(--text-secondary); margin-bottom: 12px; }
.auth-signup-btn { display: inline-block; padding: 12px 32px; background: var(--secondary); color: white; border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; transition: var(--transition); text-decoration: none; }
.auth-signup-btn:hover { background: #008a44; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,166,81,0.3); }
.auth-legal-links { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; gap: 20px; justify-content: center; }
.auth-legal-link { font-size: 12px; color: var(--text-muted); cursor: pointer; transition: var(--transition); text-decoration: none; }
.auth-legal-link:hover { color: var(--primary); text-decoration: underline; }
.discord-card { background: #f0f4ff; border-left: 4px solid #5865F2; padding: 16px; border-radius: var(--radius-sm); font-size: 14px; color: var(--text-secondary); line-height: 1.6; }
.discord-card a { color: #5865F2; text-decoration: none; font-weight: 600; }
.discord-card a:hover { text-decoration: underline; }
.discord-card code { background: #e0e4ff; padding: 2px 6px; border-radius: 4px; font-family: 'SF Mono', Monaco, monospace; font-weight: 600; color: #5865F2; }
.banned-icon { color: #dc2626; font-size: 48px; line-height: 1; margin-bottom: 16px; }

.mast-scroll-container { max-height: 400px; overflow-y: auto; min-width: 280px; }
.mast-entry { border-bottom: 1px solid var(--border); padding: 16px 0; }
.mast-entry:last-child { border-bottom: none; }
.operator-label { font-weight: 700; font-size: 14px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; padding-bottom: 8px; border-bottom: 2px solid currentColor; }
.mast-entry table { width: 100%; font-size: 12px; border-collapse: collapse; }
.mast-entry td { padding: 6px 0; border-bottom: 1px solid #f0f0f0; }
.mast-entry td:first-child { color: var(--text-muted); width: 40%; font-weight: 600; }
.gmaps-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; background: var(--primary); color: white !important; text-decoration: none; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; transition: var(--transition); }
.gmaps-btn:hover { background: var(--primary-dark); }

.maplibregl-ctrl-group { border-radius: var(--radius-sm) !important; box-shadow: var(--shadow-md) !important; overflow: hidden; }
.maplibregl-ctrl-group button { border: none !important; }
.maplibregl-popup-content { padding: 0 !important; border-radius: var(--radius-lg) !important; box-shadow: var(--shadow-lg) !important; font-family: 'Inter', sans-serif !important; overflow: hidden; min-width: 300px; }
.maplibregl-popup-close-button { font-size: 20px !important; padding: 12px !important; color: var(--text-muted) !important; right: 4px !important; top: 4px !important; width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border-radius: 50%; transition: var(--transition); }
.maplibregl-popup-close-button:hover { background: var(--bg-light) !important; color: var(--text-primary) !important; }

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }

.layer-search-wrapper { position: relative; margin-bottom: 16px; }
.layer-search-input { width: 100%; padding: 10px 12px 10px 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; font-family: inherit; background: var(--bg-white); transition: var(--transition); }
.layer-search-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.layer-search-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-muted); }
.layer-category.hidden, .layer-item.hidden { display: none !important; }
.no-results-msg { text-align: center; padding: 20px; color: var(--text-muted); font-size: 13px; }

.nav-dropdown { position: relative; }
.nav-chevron { width: 12px; height: 12px; margin-left: 2px; transition: transform 0.2s ease; }
.nav-dropdown:hover .nav-chevron { transform: rotate(180deg); }
.nav-dropdown-menu { position: absolute; top: 100%; left: 0; min-width: 220px; background: var(--bg-white); border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 8px 0; opacity: 0; visibility: hidden; transform: translateY(-10px); transition: all 0.2s ease; z-index: 3000; margin-top: 8px; }
.nav-dropdown:hover .nav-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-section { padding: 4px 8px; }
.dropdown-section-title { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 8px 12px 4px; }
.dropdown-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: none; background: none; font-size: 13px; font-family: inherit; color: var(--text-primary); cursor: pointer; border-radius: var(--radius-sm); transition: var(--transition); text-align: left; }
.dropdown-item:hover { background: var(--primary-light); color: var(--primary); }
.dropdown-item.active { background: var(--primary-light); color: var(--primary); }
.dropdown-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.map-type-item svg { opacity: 0; }
.map-type-item.active svg { opacity: 1; }
.dropdown-divider { height: 1px; background: var(--border); margin: 8px 0; }

.zoom-controls { display: flex; gap: 4px; margin-right: 12px; }
.zoom-btn { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-white); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); color: var(--text-secondary); }
.zoom-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.zoom-btn svg { width: 16px; height: 16px; }

#map.custom-cursor .maplibregl-canvas-container { cursor: crosshair !important; }
#map.custom-cursor .maplibregl-canvas { cursor: crosshair !important; }
#map.custom-cursor.feature-hover .maplibregl-canvas-container,
#map.custom-cursor.feature-hover .maplibregl-canvas { cursor: pointer !important; }
#map.measure-mode .maplibregl-canvas-container,
#map.measure-mode .maplibregl-canvas { cursor: crosshair !important; }

.search-history { margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-light); max-height: 200px; overflow-y: auto; }
.search-history-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); padding: 10px 12px 6px; border-bottom: 1px solid var(--border); }
.search-history-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; transition: var(--transition); border-bottom: 1px solid var(--border); }
.search-history-item:last-child { border-bottom: none; }
.search-history-item:hover { background: var(--bg-white); }
.search-history-item svg { width: 14px; height: 14px; color: var(--text-muted); flex-shrink: 0; }
.search-history-text { flex: 1; font-size: 13px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-history-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--text-muted); }

.sf-filter-box { background: var(--bg-light); border-radius: var(--radius-sm); padding: 12px; margin: 8px 0 8px 30px; }
.sf-filter-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; user-select: none; -webkit-user-select: none; }
.sf-filter-buttons { display: flex; flex-wrap: wrap; gap: 6px; }
.sf-filter-btn { padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-white); font-size: 11px; font-weight: 500; font-family: inherit; cursor: pointer; transition: var(--transition); color: var(--text-secondary); user-select: none; -webkit-user-select: none; caret-color: transparent; }
.sf-filter-btn:hover { border-color: var(--btn-color, var(--primary)); color: var(--btn-color, var(--primary)); background: var(--bg-light); }
.sf-filter-btn.active { background: var(--btn-color, var(--primary)); border-color: var(--btn-color, var(--primary)); color: white; }
.sf-filter-btn[data-operator="all"],
.sf-filter-btn[data-licensee="all"],
.sf-filter-btn[data-location="all"],
.sf-filter-btn[data-layer="all"] { --btn-color: var(--primary); }

.measurement-tooltip { position: fixed; background: var(--bg-dark); color: white; padding: 8px 12px; border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; pointer-events: none; z-index: 2000; white-space: nowrap; }
.measurement-result { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--bg-white); padding: 12px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 16px; z-index: 1500; }
.measurement-result.hidden { display: none; }
.measurement-value { font-size: 18px; font-weight: 700; color: var(--primary); }
.measurement-label { font-size: 12px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.measurement-close { background: none; border: none; cursor: pointer; color: var(--text-muted); padding: 4px; }
.measurement-close:hover { color: var(--text-primary); }
.measurement-group { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.measurement-divider-v { width: 1px; height: 36px; background: var(--border); }

.tool-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 3000; }
.tool-modal.hidden { display: none; }
.tool-modal-content { background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 90%; max-width: 420px; overflow: hidden; }
.tool-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; background: var(--bg-light); border-bottom: 1px solid var(--border); }
.tool-modal-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-primary); }
.tool-modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); line-height: 1; }
.tool-modal-close:hover { color: var(--text-primary); }
.tool-modal-body { padding: 20px; }
.tool-input-group { margin-bottom: 12px; }
.tool-input-group label { display: block; font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 4px; }
.tool-input-group input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; }
.tool-input-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,102,204,0.1); }
.tool-input-row { display: flex; gap: 8px; }
.tool-input-row .tool-input-group { flex: 1; }
.tool-btn { width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; margin-top: 8px; transition: var(--transition); }
.tool-btn:hover { background: var(--primary-dark); }
.tool-result { margin-top: 16px; padding: 12px; background: var(--bg-light); border-radius: var(--radius-sm); font-size: 14px; color: var(--text-primary); min-height: 40px; }
.tool-result:empty { display: none; }
.tool-hint { margin-top: 12px; font-size: 12px; color: var(--text-muted); }
.tool-tabs { display: flex; gap: 4px; margin-bottom: 16px; }
.tool-tab { flex: 1; padding: 8px 12px; background: var(--bg-light); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; font-weight: 500; cursor: pointer; color: var(--text-secondary); transition: var(--transition); }
.tool-tab:hover { background: var(--primary-light); }
.tool-tab.active { background: var(--primary); color: white; border-color: var(--primary); }
.tool-tab-content { display: none; }
.tool-tab-content.active { display: block; }

.popup-container { max-height: 450px; overflow-y: auto; }
.popup-entry { border-bottom: 1px solid var(--border); }
.popup-entry:last-child { border-bottom: none; }
.popup-header { padding: 16px 20px; display: flex; align-items: center; gap: 12px; }
.popup-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.popup-icon svg { width: 20px; height: 20px; color: white; }
.popup-title-group { flex: 1; min-width: 0; }
.popup-operator { font-weight: 700; font-size: 15px; color: var(--text-primary); margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.popup-type { font-size: 12px; color: var(--text-muted); margin: 2px 0 0 0; }
.popup-body { padding: 0 20px 16px; }
.popup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.popup-field { display: flex; flex-direction: column; gap: 2px; }
.popup-field.full-width { grid-column: span 2; }
.popup-field-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.popup-field-value { font-size: 13px; color: var(--text-primary); font-weight: 500; }
.popup-divider { height: 1px; background: var(--border); margin: 12px 0; }
.popup-coords { display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--bg-light); border-radius: var(--radius-sm); font-size: 12px; color: var(--text-secondary); font-family: 'SF Mono', Monaco, monospace; }
.popup-coords svg { width: 14px; height: 14px; color: var(--text-muted); }
.popup-actions { padding: 12px 20px 16px; display: flex; gap: 8px; }
.popup-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 14px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600; text-decoration: none; transition: var(--transition); cursor: pointer; border: none; }
.popup-btn-primary { background: var(--primary); color: white; }
.popup-btn-primary:hover { background: var(--primary-dark); }
.popup-btn-secondary { background: var(--bg-light); color: var(--text-secondary); }
.popup-btn-secondary:hover { background: var(--border); }
.popup-btn svg { width: 14px; height: 14px; }
.popup-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; }
.popup-badge-active { background: #dcfce7; color: #16a34a; }
.popup-badge-inactive { background: #fef3c7; color: #d97706; }
.popup-tech-badge { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-weight: 700; margin-right: 4px; }
.popup-tech-5g { background: #7c3aed; color: white; }
.popup-tech-4g { background: #2563eb; color: white; }
.popup-tech-3g { background: #059669; color: white; }
.popup-tech-2g { background: #64748b; color: white; }

.maplibregl-ctrl-bottom-right { display: none !important; }

.los-config-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9998; display: none; align-items: center; justify-content: center; }
.los-config-modal.active { display: flex; }
.los-config-content { background: white; padding: 28px; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 90%; max-width: 420px; }
.los-config-title { font-size: 19px; font-weight: 600; color: var(--text-primary); margin-bottom: 22px; }
.los-config-group { margin-bottom: 18px; }
.los-config-label { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 8px; display: block; }
.los-config-input { width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; }
.los-config-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }
.los-config-actions { display: flex; gap: 10px; margin-top: 24px; }
.los-config-btn { flex: 1; padding: 12px; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 500; cursor: pointer; transition: var(--transition); font-family: inherit; }
.los-config-btn.primary { background: var(--primary); color: white; }
.los-config-btn.primary:hover { background: var(--primary-dark); }
.los-config-btn.secondary { background: var(--bg-light); color: var(--text-primary); border: 1px solid var(--border); }
.los-config-btn.secondary:hover { background: var(--border); }

.los-loading-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,22,40,0.85); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 10000; flex-direction: column; gap: 20px; }
.los-loading-overlay.active { display: flex; }
.spinner { width: 60px; height: 60px; border: 4px solid rgba(255,255,255,0.2); border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.los-loading-text { color: white; font-size: 16px; font-weight: 500; }
.los-overlay-controls { position: fixed; top: 72px; right: 12px; background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 14px; z-index: 1400; max-width: 320px; max-height: calc(100vh - 84px); overflow-y: auto; }
.los-control-header { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.los-overlay-item { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; background: var(--bg-light); border-radius: var(--radius-sm); margin-bottom: 8px; }
.los-overlay-info { flex: 1; min-width: 0; }
.los-overlay-name { font-size: 13px; font-weight: 500; color: var(--text-primary); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.los-overlay-meta { font-size: 11px; color: var(--text-muted); }
.los-remove-btn { width: 26px; height: 26px; border-radius: 50%; border: none; background: #dc2626; color: white; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: var(--transition); font-size: 16px; font-weight: bold; flex-shrink: 0; margin-left: 10px; }
.los-remove-btn:hover { background: #b91c1c; transform: scale(1.05); }

@media (max-width: 768px) {
  #top-taskbar { padding: 0 12px; }
  .brand-tagline { display: none; }
  .nav-item span { display: none; }
  .nav-chevron { display: none; }
  .status-indicator { display: none; }
  #menu { width: calc(100% - 24px); left: 12px; right: 12px; max-height: 70vh; }
  .panel-content { max-height: 50vh; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .nav-dropdown-menu { position: fixed; top: 60px; left: 12px; right: 12px; width: auto; max-height: 70vh; overflow-y: auto; }
}

/* ===== NEW CSS (from MASTS_ADDITIONS) ===== */

.nearby-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,22,40,0.75); backdrop-filter: blur(3px); z-index: 5000; display: none; align-items: center; justify-content: center; padding: 16px; }
.nearby-modal.active { display: flex; }
.nearby-content { background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 520px; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; animation: slideUp 0.25s ease; }
.nearby-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); background: var(--bg-light); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.nearby-header h3 { margin: 0; font-size: 16px; font-weight: 600; color: var(--text-primary); }
.nearby-header p { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); }
.nearby-close { background: var(--bg-light); border: 1px solid var(--border); border-radius: var(--radius-sm); width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 18px; color: var(--text-muted); transition: var(--transition); flex-shrink: 0; }
.nearby-close:hover { background: var(--border); color: var(--text-primary); }
.nearby-list { overflow-y: auto; padding: 12px; flex: 1; }
.nearby-item { display: flex; align-items: flex-start; gap: 12px; padding: 13px 14px; border: 1px solid var(--border); border-radius: var(--radius-md); margin-bottom: 10px; background: var(--bg-white); transition: var(--transition); }
.nearby-item:last-child { margin-bottom: 0; }
.nearby-item:hover { background: var(--bg-light); border-color: var(--primary); }
.nearby-rank { width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: white; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 2px; }
.nearby-info { flex: 1; min-width: 0; }
.nearby-name { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 3px; }
.nearby-meta { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.nearby-meta span { display: inline-block; margin-right: 10px; }
.nearby-distance { font-size: 13px; font-weight: 700; color: var(--primary); white-space: nowrap; flex-shrink: 0; text-align: right; }
.nearby-distance small { display: block; font-weight: 400; color: var(--text-muted); font-size: 11px; }
.nearby-actions { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.nearby-btn { padding: 5px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 11px; font-weight: 600; cursor: pointer; background: var(--bg-light); color: var(--text-secondary); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: var(--transition); }
.nearby-btn:hover { background: var(--primary); color: white; border-color: var(--primary); }
.nearby-btn.maps { background: var(--primary); color: white; border-color: var(--primary); }
.nearby-btn.maps:hover { background: var(--primary-dark); }
.nearby-empty { text-align: center; padding: 32px; color: var(--text-muted); font-size: 14px; }
.nearby-footer { padding: 12px 16px; border-top: 1px solid var(--border); background: var(--bg-light); font-size: 11px; color: var(--text-muted); flex-shrink: 0; }

.map-context-hint { position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%); background: var(--bg-dark); color: white; padding: 8px 16px; border-radius: 20px; font-size: 12px; font-weight: 500; z-index: 1400; pointer-events: none; opacity: 0; transition: opacity 0.3s ease; white-space: nowrap; }
.map-context-hint.show { opacity: 1; }

.protools-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,22,40,0.75); backdrop-filter: blur(3px); z-index: 5000; display: none; align-items: flex-start; justify-content: center; padding: 72px 16px 16px; overflow-y: auto; }
.protools-modal.active { display: flex; }
.protools-content { background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 620px; animation: slideUp 0.25s ease; }
.protools-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); background: var(--bg-light); border-radius: var(--radius-lg) var(--radius-lg) 0 0; display: flex; align-items: center; justify-content: space-between; }
.protools-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.protools-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); padding: 2px 6px; transition: var(--transition); }
.protools-close:hover { color: var(--text-primary); }
.protools-tabs { display: flex; overflow-x: auto; gap: 0; border-bottom: 1px solid var(--border); padding: 0 16px; background: var(--bg-white); }
.protools-tab { padding: 11px 14px; font-size: 12px; font-weight: 600; cursor: pointer; border: none; background: none; color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: var(--transition); font-family: inherit; }
.protools-tab:hover { color: var(--primary); }
.protools-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.protools-body { padding: 20px; }
.protool-section { display: none; }
.protool-section.active { display: block; }
.protool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.protool-row.single { grid-template-columns: 1fr; }
.protool-row.triple { grid-template-columns: 1fr 1fr 1fr; }
.protool-group { display: flex; flex-direction: column; gap: 5px; }
.protool-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.protool-group input, .protool-group select { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 14px; font-family: inherit; background: var(--bg-white); color: var(--text-primary); transition: var(--transition); }
.protool-group input:focus, .protool-group select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-light); }
.protool-calc-btn { width: 100%; padding: 12px; background: var(--primary); color: white; border: none; border-radius: var(--radius-sm); font-size: 14px; font-weight: 600; cursor: pointer; font-family: inherit; transition: var(--transition); margin-top: 8px; }
.protool-calc-btn:hover { background: var(--primary-dark); }
.protool-result { margin-top: 14px; background: var(--bg-light); border-radius: var(--radius-md); padding: 14px 16px; border-left: 3px solid var(--primary); display: none; }
.protool-result.show { display: block; }
.protool-result-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin-bottom: 10px; }
.protool-result-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.protool-metric { background: var(--bg-white); border-radius: var(--radius-sm); padding: 10px 12px; border: 1px solid var(--border); }
.protool-metric-label { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; font-weight: 500; }
.protool-metric-value { font-size: 16px; font-weight: 700; color: var(--primary); }
.protool-metric-value.warn { color: #d97706; }
.protool-metric-value.danger { color: #dc2626; }
.protool-metric-value.good { color: #059669; }
.protool-hint { font-size: 12px; color: var(--text-muted); margin-top: 10px; line-height: 1.5; padding: 10px 12px; background: var(--bg-light); border-radius: var(--radius-sm); }
.protool-divider { height: 1px; background: var(--border); margin: 16px 0; }
#earfcn-bands-table { width: 100%; font-size: 12px; border-collapse: collapse; margin-top: 12px; }
#earfcn-bands-table th { text-align: left; padding: 8px 10px; background: var(--bg-light); font-weight: 600; color: var(--text-secondary); font-size: 11px; text-transform: uppercase; border-bottom: 1px solid var(--border); }
#earfcn-bands-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
#earfcn-bands-table tr:last-child td { border-bottom: none; }
#earfcn-bands-table tr.highlight td { background: #e6f0fa; font-weight: 600; color: var(--primary); }

.elevation-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(10,22,40,0.75); backdrop-filter: blur(3px); z-index: 5000; display: none; align-items: center; justify-content: center; padding: 16px; }
.elevation-modal.active { display: flex; }
.elevation-content { background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 700px; max-height: 85vh; display: flex; flex-direction: column; overflow: hidden; animation: slideUp 0.25s ease; }
.elevation-header { padding: 18px 20px 14px; border-bottom: 1px solid var(--border); background: var(--bg-light); display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; }
.elevation-header h3 { margin: 0; font-size: 16px; font-weight: 600; }
.elevation-header p { margin: 4px 0 0; font-size: 12px; color: var(--text-muted); }
.elevation-close { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-muted); padding: 2px 6px; }
.elevation-close:hover { color: var(--text-primary); }
.elevation-controls { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; flex-shrink: 0; background: var(--bg-white); }
.elev-status { font-size: 12px; color: var(--text-muted); flex: 1; min-width: 160px; }
.elev-status strong { color: var(--text-primary); }
.elevation-btn { padding: 8px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 12px; font-weight: 600; cursor: pointer; background: var(--bg-light); color: var(--text-secondary); transition: var(--transition); font-family: inherit; }
.elevation-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }
.elevation-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.elevation-body { padding: 16px; overflow-y: auto; flex: 1; }
.elevation-chart-container { width: 100%; position: relative; margin-top: 8px; }
.elevation-chart-container canvas { width: 100% !important; }
.elevation-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.elev-stat { background: var(--bg-light); border-radius: var(--radius-sm); padding: 10px 12px; text-align: center; }
.elev-stat-label { font-size: 11px; color: var(--text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.3px; }
.elev-stat-value { font-size: 18px; font-weight: 700; color: var(--primary); margin-top: 3px; }
.elevation-points-list { margin-top: 12px; font-size: 12px; }
.elevation-points-list table { width: 100%; border-collapse: collapse; }
.elevation-points-list th { text-align: left; padding: 7px 8px; background: var(--bg-light); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.elevation-points-list td { padding: 7px 8px; border-bottom: 1px solid var(--border); color: var(--text-primary); }
.elevation-points-list tr:last-child td { border-bottom: none; }
.elevation-loading { text-align: center; padding: 24px; color: var(--text-muted); font-size: 13px; }
.elevation-loading .mini-spinner { width: 24px; height: 24px; border: 3px solid var(--border); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; margin: 0 auto 10px; }

/* ===== ELEVATION PANEL — docked bottom-right so map stays interactive ===== */
.elevation-modal { position: fixed; bottom: 20px; right: 20px; top: auto; left: auto; width: 100%; max-width: 560px; background: transparent; backdrop-filter: none; z-index: 4000; display: none; align-items: flex-end; justify-content: flex-end; padding: 0; pointer-events: none; }
.elevation-modal.active { display: flex; }
.elevation-content { pointer-events: all; background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: 0 8px 40px rgba(0,0,0,0.22); width: 100%; max-height: 70vh; display: flex; flex-direction: column; overflow: hidden; animation: slideUp 0.25s ease; border: 1px solid var(--border); }

/* ===== SIGNAL DIAGRAM ===== */
.signal-diagram-container { background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 12px 8px 4px; margin: 12px 0; overflow: hidden; }

/* ===== NEARBY DISCLAIMER ===== */
.nearby-disclaimer { margin: 10px 0 4px; padding: 10px 14px; background: #fffbeb; border: 1px solid #fde68a; border-radius: var(--radius-sm); font-size: 11.5px; color: #92400e; line-height: 1.55; }

/* ===== LOS config height auto-fill indicator ===== */
.los-config-input[style*="background"] { border-color: var(--primary) !important; }

/* ===== WTR LINKED SITES in popup ===== */
.wtr-linked-sites { margin-top: 2px; }
.wtr-linked-title { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #6366f1; text-transform: uppercase; letter-spacing: 0.4px; margin-bottom: 8px; }
.wtr-linked-badge { background: #6366f1; color: white; font-size: 10px; font-weight: 700; border-radius: 10px; padding: 1px 6px; margin-left: 2px; }
.wtr-linked-item { background: #f8f7ff; border: 1px solid #e0e0f5; border-radius: var(--radius-sm); padding: 8px 10px; margin-bottom: 6px; }
.wtr-linked-coords { font-size: 12px; font-weight: 600; color: var(--text-primary); font-family: monospace; margin-bottom: 4px; }
.wtr-linked-meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; }
.wtr-linked-meta span { background: white; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
.wtr-linked-zoom { font-size: 11px; font-weight: 600; color: #6366f1; background: none; border: 1px solid #c4b5fd; border-radius: 4px; padding: 3px 8px; cursor: pointer; transition: var(--transition); }
.wtr-linked-zoom:hover { background: #ede9fe; }
.wtr-linked-note { font-size: 11px; color: var(--text-muted); margin-top: 6px; line-height: 1.4; padding: 6px 8px; background: #fffbeb; border-radius: 4px; border-left: 3px solid #f59e0b; }
.elev-point-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); margin-right: 4px; }