*, *::before, *::after { box-sizing: border-box; }
body, html { width: 100%; height: 100dvh; margin: 0; font-family: 'Segoe UI', sans-serif; overflow: hidden; background: #111; }

#app-wrapper { display: grid; width: 100%; height: 100%; grid-template-columns: 1fr; grid-template-rows: 1fr max-content; grid-template-areas: "map" "controls"; }
#app-wrapper.show-sidebar { grid-template-columns: 1fr 380px; grid-template-areas: "map sidebar" "controls sidebar"; }
#map-container { grid-area: map; position: relative; width: 100%; height: 100%; min-height: 0; min-width: 0; }

#left-panel { position: absolute; top: 15px; left: 15px; z-index: 2500; display: flex; flex-direction: column; gap: 15px; width: 360px; max-width: calc(100vw - 30px); pointer-events: none; }
.map-overlay { position: relative; background: rgba(20, 20, 20, 0.95); color: #fff; border: 1px solid #444; border-radius: 8px; box-shadow: 0 4px 15px rgba(0,0,0,0.5); pointer-events: auto; padding: 12px; }

.search-row { display: flex; width: 100%; height: 36px; border: 1px solid #555; border-radius: 4px; overflow: hidden; }
.search-row input { flex: 1; border: none; padding: 0 10px; font-size: 14px; background: transparent; color: #fff; outline: none; }
.search-row button { border: none; background: #FFCA28; color: #111; padding: 0 16px; cursor: pointer; font-weight: bold; transition: background 0.2s; }
.search-row button:hover { background: #FFB300; }

.loc-header-row { display: flex; justify-content: space-between; align-items: center; }
.info-coords { font-size: 16px; font-weight: 800; font-family: 'Oswald', sans-serif; text-transform: uppercase;}

#sidebar-column { grid-area: sidebar; display: flex; flex-direction: column; background: #1a1a1a; border-left: 1px solid #333; z-index: 2100; color: #fff; }
.sidebar-header { padding: 20px; border-bottom: 1px solid #333; }
.sidebar-header h2 { margin: 0; font-size: 22px; color: #FFCA28; font-family: 'Oswald', sans-serif; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 15px; }

.intel-card { background: rgba(0,0,0,0.6); border-radius: 6px; padding: 15px; flex: 0 0 auto; min-height: 120px; display: flex; flex-direction: column; }
.gemini-output { flex: 1 1 auto; margin-top: 8px; font-size: 13.5px; line-height: 1.6; color: #e0e0e0; }

#controls { grid-area: controls; background: rgba(20, 20, 20, 0.98); color: #fff; padding: 12px 20px; box-shadow: 0 -4px 15px rgba(0, 0, 0, .5); z-index: 2000; }
.compact-header { display: flex; justify-content: space-between; border-bottom: 1px solid #444; padding-bottom: 6px; margin-bottom: 8px; }
.highlight-data { font-weight: 800; color: #FFCA28; font-size: 16px; }
.pinned-controls { display: grid; gap: 20px; align-items: center; }
.pinned-item { display: flex; flex-direction: column; }
.pinned-item label { font-size: 11px; color: #aaa; text-transform: uppercase; margin-bottom: 4px; }

.hidden { display: none !important; }
.pro-btn { background: #444; border: 1px solid #666; color: #fff; font-size: 10px; border-radius: 4px; cursor: pointer; float: right; padding: 4px 8px; text-transform: uppercase; font-weight: bold; }
.pro-btn:hover { background: #00B0FF; border-color: #00B0FF; }
.spinner { border: 3px solid #333; border-top: 3px solid #FFCA28; border-radius: 50%; width: 30px; height: 30px; animation: spin 1s linear infinite; margin: 0 auto 10px; }
@keyframes spin { 0% { transform: rotate(0); } 100% { transform: rotate(360deg); } }