:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --border: #e5e7ef;
  --text: #111827;
  --primary: #2563eb;
  --danger: #dc2626;

  --leftW: 360px;
  --satW: 56%;
  --propH: 280px;
}


* {
  box-sizing: border-box;
  outline: none;
}




html,
body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  /* Prevent body scroll */
}

/* --- Layout --- */
#app {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#leftPane {
  width: var(--leftW);
  min-width: 280px;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border-right: 1px solid var(--border);
  z-index: 10;
  height: 100%;
}

#mainPane {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* Prevent flex overflow */
}

/* --- Sections & Panes --- test*/
.pane-title {
  padding: 10px 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  background: #f9fafb;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #6b7280;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

#propPane {
  height: var(--propH);
  min-height: 100px;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

#prop-list {
  flex: 1;
  overflow-y: auto;
}

.prop-item {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}

.prop-item:hover {
  background: #f3f4f6;
}

.prop-item.active {
  background: #eff6ff;
  border-left: 3px solid var(--primary);
}

.prop-line1 {
  font-weight: 600;
  margin-bottom: 2px;
}

.prop-line2 {
  color: #6b7280;
  font-size: 11px;
}

#streetPane {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--border);
  /* Fix for flexbox resizing issue */
  min-height: 0;
  overflow: hidden;
}

.street-frame {
  flex: 1;
  position: relative;
  background: #000;
  min-height: 0;
}

.street-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --- Sidebar Controls --- */
.controls {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  flex-shrink: 0;
  overflow-y: auto;
  max-height: 50%;
}

.control-row {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.control-row:last-child {
  margin-bottom: 0;
}

.control-row label {
  width: 70px;
  /* Fixed width for alignment */
  color: #4b5563;
  font-weight: 600;
  font-size: 11px;
}

.control-row input {
  flex: 1;
  margin: 0 8px;
  cursor: pointer;
}

.val {
  width: 24px;
  text-align: right;
  color: #6b7280;
  font-size: 11px;
  font-family: monospace;
}

/* --- Top Banner --- */
#topBanner {
  height: 48px;
  border-bottom: 1px solid var(--border);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  white-space: nowrap;
  /* Prevent wrapping */
  flex-shrink: 0;
}

.banner-left,
.banner-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.banner-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f3f4f6;
  padding: 2px 8px 2px 4px;
  border-radius: 4px;
  border: 1px solid var(--border);
}

/* Prevent banner sliders from being too wide */
.banner-item input[type="range"] {
  width: 80px;
  margin: 0;
  vertical-align: middle;
}

.pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #4b5563;
  background: #e5e7eb;
  padding: 2px 6px;
  border-radius: 4px;
}

.lbl {
  font-weight: 500;
  color: #6b7280;
  font-size: 11px;
}

/* --- Maps Row --- */
#mapsRow {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.mapbox {
  position: relative;
  display: flex;
  flex-direction: column;
}

#satBox {
  width: var(--satW);
  min-width: 200px;
}

#roadBox {
  flex: 1;
  min-width: 200px;
}

.map-frame {
  flex: 1;
  position: relative;
  background: #e5e7eb;
  overflow: hidden;
}

.map-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.map-frame canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --- Resizers --- */
.h-resizer {
  height: 6px;
  background: #f3f4f6;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  cursor: row-resize;
  flex-shrink: 0;
}

.h-resizer:hover {
  background: #e5e7eb;
}

.v-resizer {
  width: 6px;
  background: #f3f4f6;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  cursor: col-resize;
  flex-shrink: 0;
  z-index: 20;
}

.v-resizer:hover {
  background: #d1d5db;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 1px solid var(--border);
  background: #fff;
  color: #374151;
  border-radius: 4px;
  font-weight: 600;
  font-size: 11px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  height: 28px;
}

.btn:hover {
  background: #f9fafb;
  border-color: #d1d5db;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
}

.btn-primary:hover {
  background: #1d4ed8;
}

.btn-success {
  background: #10b981;
  color: #fff;
  border: none;
}

.btn-success:hover {
  background: #059669;
}

.btn-ghost {
  background: transparent;
  border: 1px solid transparent;
  color: #4b5563;
}

.btn-ghost:hover {
  background: #f3f4f6;
  color: #111827;
}

.chk {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  user-select: none;
}

/* --- PDF Overlay --- */
.pdf-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  /* Semi-transparent white */
  backdrop-filter: blur(3px);
  /* Blur background */
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pdf-box {
  background: white;
  padding: 24px 40px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  text-align: center;
  border: 1px solid #e5e7ef;
  min-width: 300px;
}

.pdf-text {
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  margin-top: 10px;
}

.pdf-spinner {
  width: 28px;
  height: 28px;
  margin: 0 auto;
  border: 3px solid #e5e7eb;
  border-top-color: #2563eb;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}