/* ══════════════════════════════════════════════
   Berlin Location Score — Premium Dark Terminal
   ══════════════════════════════════════════════ */

/* ── Design Tokens ───────────────────────────── */
:root {
  --bg-deep: #060a0e;
  --glass-bg: rgba(10, 14, 20, 0.92);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-border-hover: rgba(255, 255, 255, 0.12);
  --accent-green: #00ff88;
  --accent-cyan: #00d4ff;
  --accent-green-dim: rgba(0, 255, 136, 0.15);
  --accent-cyan-dim: rgba(0, 212, 255, 0.15);
  --text-primary: #e8ecf1;
  --text-secondary: #7a8a9e;
  --text-muted: #4a5568;
  --ticker-bg: #000000;
  --btn-bg: rgba(15, 20, 28, 0.8);
  --btn-bg-hover: rgba(20, 28, 40, 0.9);
  --btn-active-bg: rgba(0, 255, 136, 0.08);
  --btn-active-border: rgba(0, 255, 136, 0.4);
  --toggle-bg: rgba(15, 20, 28, 0.6);

  --font-mono: "SF Mono", "Cascadia Code", "Consolas", "Fira Code", monospace;

  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;

  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --shadow-glow-green: 0 0 12px rgba(0, 255, 136, 0.2);
  --shadow-glow-cyan: 0 0 12px rgba(0, 212, 255, 0.2);

  --z-ticker: 1100;
  --z-sidebar: 1000;
  --z-map: 1;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ── Reset & Base ────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-mono);
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── App Layout ──────────────────────────────── */
#app { display: flex; flex-direction: column; height: 100vh; width: 100vw; }
.app-main { position: relative; flex: 1; overflow: hidden; }

/* ── Stats Ticker ────────────────────────────── */
#stats-ticker {
  height: 48px; min-height: 48px;
  background: var(--ticker-bg);
  border-bottom: 1px solid var(--glass-border);
  z-index: var(--z-ticker);
  overflow: hidden; display: flex; align-items: center;
}
.ticker-marquee { width: 100%; overflow: hidden; position: relative; }
#ticker-track {
  display: flex; white-space: nowrap;
  animation: marquee-scroll 45s linear infinite;
  width: max-content;
}
.ticker-copy { display: inline-flex; gap: var(--space-xl); padding-right: var(--space-xl); flex-shrink: 0; }
#ticker-track:hover { animation-play-state: paused; }
.ticker-chip { display: inline-flex; align-items: center; gap: var(--space-sm); font-size: 12px; letter-spacing: 0.5px; }
.ticker-chip-label { color: var(--text-muted); text-transform: uppercase; font-size: 10px; letter-spacing: 1px; }
.ticker-chip-value { color: var(--accent-green); font-weight: 600; text-shadow: 0 0 8px rgba(0, 255, 136, 0.3); }

@keyframes marquee-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ── Sidebar ─────────────────────────────────── */
#sidebar {
  position: absolute;
  top: var(--space-md); left: var(--space-md);
  width: 300px;
  max-height: calc(100% - var(--space-xl));
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
  display: flex; flex-direction: column;
  padding: var(--space-lg) var(--space-md);
  overflow-y: auto;
  z-index: var(--z-sidebar);
  scrollbar-width: thin;
  scrollbar-color: var(--text-muted) transparent;
}
#sidebar::-webkit-scrollbar { width: 4px; }
#sidebar::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 2px; }
#sidebar-handle { display: none; }

.sidebar-title { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 2px; letter-spacing: -0.3px; }
.sidebar-subtitle { font-size: 10px; color: var(--text-muted); margin-bottom: var(--space-md); text-transform: uppercase; letter-spacing: 1.5px; }

/* ── Tab Switcher ────────────────────────────── */
.tab-switcher {
  display: flex; gap: 2px; padding: 3px;
  background: var(--toggle-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-md);
}
.tab-btn {
  flex: 1; padding: 7px 8px;
  background: transparent; border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 1px; cursor: pointer;
  transition: all var(--transition-fast);
}
.tab-btn:hover { color: var(--text-secondary); }
.tab-btn.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-glow-cyan);
}

/* ── Tab Panels ──────────────────────────────── */
.tab-panel { display: none; flex-direction: column; }
.tab-panel.active { display: flex; }

/* ── Section Helpers ─────────────────────────── */
.section-divider { height: 1px; background: var(--glass-border); margin: var(--space-md) 0; }
.section-label {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1.5px;
  margin-bottom: var(--space-sm);
}

/* ── Layer Buttons ───────────────────────────── */
.layer-group { display: flex; flex-direction: column; gap: var(--space-xs); margin-bottom: var(--space-md); }

.layer-btn, .hex-layer-btn, .amenity-toggle-btn {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 8px 10px;
  background: var(--btn-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px; cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.3px;
  width: 100%;
}
.layer-btn:hover, .hex-layer-btn:hover, .amenity-toggle-btn:hover {
  background: var(--btn-bg-hover);
  border-color: var(--glass-border-hover);
  color: var(--text-primary);
}
.layer-btn.active, .hex-layer-btn.active, .amenity-toggle-btn.active {
  background: var(--btn-active-bg);
  border-color: var(--btn-active-border);
  color: #fff;
  box-shadow: var(--shadow-glow-green);
}

.layer-indicator {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); flex-shrink: 0;
  transition: all var(--transition-fast);
}
.layer-btn.active .layer-indicator,
.hex-layer-btn.active .layer-indicator,
.amenity-toggle-btn.active .layer-indicator {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
  animation: dot-pulse-green 2s ease-in-out infinite;
}
.layer-label { flex: 1; }

/* ── Amenity Toggles ─────────────────────────── */
.amenity-toggles { display: flex; flex-direction: column; gap: var(--space-xs); }
.amenity-group-header {
  font-size: 10px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
  margin-top: var(--space-sm); margin-bottom: 2px;
  padding-left: 2px;
}
.amenity-toggle-btn { padding: 6px 10px; font-size: 10px; }

/* ── District Toggle ─────────────────────────── */
.district-toggle-btn {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; padding: 10px 12px;
  background: var(--btn-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 12px; cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.3px;
  margin-bottom: var(--space-xs);
}
.district-toggle-btn:hover { background: var(--btn-bg-hover); border-color: var(--glass-border-hover); color: var(--text-primary); }
.district-toggle-btn.active { background: var(--btn-active-bg); border-color: var(--btn-active-border); color: #fff; box-shadow: var(--shadow-glow-green); }
.district-toggle-btn.active .layer-indicator { background: var(--accent-green); box-shadow: 0 0 6px var(--accent-green); animation: dot-pulse-green 2s ease-in-out infinite; }

/* ── Isochrone Radius Selector ───────────────── */
.iso-radius-group {
  display: flex; gap: 2px; margin-bottom: var(--space-md);
}
.iso-radius-btn {
  flex: 1; padding: 5px;
  background: var(--btn-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  cursor: pointer; transition: all var(--transition-fast);
}
.iso-radius-btn:hover { color: var(--text-secondary); border-color: var(--glass-border-hover); }
.iso-radius-btn.active { background: var(--accent-green-dim); color: var(--accent-green); border-color: var(--btn-active-border); }

/* ── Pin Drop Mode ──────────────────────────── */
.pin-mode-btn {
  display: flex; align-items: center; gap: var(--space-sm);
  width: 100%; padding: 10px 12px;
  background: var(--btn-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 11px; cursor: pointer;
  transition: all var(--transition-fast);
}
.pin-mode-btn:hover { background: var(--btn-bg-hover); border-color: var(--glass-border-hover); color: var(--text-primary); }
.pin-mode-btn.active {
  background: rgba(0, 212, 255, 0.08);
  border-color: rgba(0, 212, 255, 0.4);
  color: var(--accent-cyan);
  box-shadow: var(--shadow-glow-cyan);
}
.pin-mode-icon { font-size: 14px; }
.pin-mode-hint {
  font-size: 10px; color: var(--accent-cyan);
  text-align: center; padding: 6px 0;
  animation: pin-hint-pulse 1.5s ease-in-out infinite;
}
@keyframes pin-hint-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}
#map.pin-mode-active { cursor: crosshair !important; }
#map.pin-mode-active .leaflet-interactive { cursor: crosshair !important; }

/* ── Property Form ───────────────────────────── */
.property-form { display: flex; flex-direction: column; gap: var(--space-sm); }
.form-group { display: flex; flex-direction: column; gap: 2px; }
.form-row { display: flex; gap: var(--space-sm); }
.form-group-half { flex: 1; }
.form-group-third { flex: 1; }
.form-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.form-input {
  padding: 7px 8px;
  background: var(--btn-bg); border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-mono); font-size: 11px;
  outline: none; transition: border-color var(--transition-fast);
  width: 100%;
}
.form-input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 6px rgba(0, 212, 255, 0.2); }
.form-input::placeholder { color: var(--text-muted); }
select.form-input { cursor: pointer; -webkit-appearance: none; appearance: none; }
.form-submit {
  padding: 8px; margin-top: var(--space-xs);
  background: var(--accent-green-dim); border: 1px solid var(--btn-active-border);
  border-radius: var(--radius-sm);
  color: var(--accent-green);
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  letter-spacing: 0.5px; cursor: pointer;
  transition: all var(--transition-fast);
}
.form-submit:hover { background: rgba(0, 255, 136, 0.15); box-shadow: var(--shadow-glow-green); }
.form-submit:disabled { opacity: 0.5; cursor: wait; }
.form-status { font-size: 11px; font-weight: 600; text-align: center; min-height: 16px; }

/* ── CSV Upload ──────────────────────────────── */
.csv-dropzone {
  padding: 16px; text-align: center;
  background: var(--btn-bg); border: 2px dashed var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 10px;
  cursor: pointer; transition: all var(--transition-fast);
}
.csv-dropzone:hover, .csv-dropzone.dragover {
  border-color: var(--accent-cyan); color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
}
.csv-progress {
  position: relative; height: 20px; margin-top: var(--space-sm);
  background: var(--btn-bg); border-radius: var(--radius-sm);
  overflow: hidden;
}
.csv-progress-fill {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--accent-green-dim); border-radius: var(--radius-sm);
  transition: width 0.3s ease;
}
.csv-progress-text {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: var(--text-secondary); font-weight: 600;
}

/* ── Property List ───────────────────────────── */
.property-list { display: flex; flex-direction: column; gap: var(--space-sm); max-height: 400px; overflow-y: auto; }
.property-list-empty { font-size: 11px; color: var(--text-muted); text-align: center; padding: var(--space-md); }
.property-list-remove {
  background: none; border: none; color: var(--text-muted);
  font-size: 14px; cursor: pointer; padding: 2px 4px;
  transition: color var(--transition-fast); flex-shrink: 0;
}
.property-list-remove:hover { color: #ff5252; }

/* ── Property Card ──────────────────────────── */
.prop-card {
  padding: 10px;
  background: var(--btn-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.prop-card:hover { background: var(--btn-bg-hover); border-color: var(--glass-border-hover); }

.prop-card-header { display: flex; align-items: flex-start; gap: var(--space-sm); margin-bottom: 6px; }
.prop-card-title-wrap { flex: 1; min-width: 0; }
.prop-card-name {
  font-size: 11px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prop-card-addr {
  font-size: 9px; color: var(--text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.prop-card-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.prop-card-chip {
  font-size: 9px; color: var(--text-secondary);
  background: rgba(255,255,255,0.04);
  padding: 2px 6px; border-radius: 3px;
  letter-spacing: 0.3px;
}

.prop-card-score-section {
  display: flex; align-items: center; gap: var(--space-sm);
  padding: 6px 0; margin-bottom: 6px;
  border-top: 1px solid rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.prop-card-score-value {
  font-size: 28px; font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 12px currentColor;
  line-height: 1;
}
.prop-card-score-right { flex: 1; }
.prop-card-score-label { font-size: 11px; font-weight: 700; }
.prop-card-score-caption {
  font-size: 8px; color: var(--text-muted);
  letter-spacing: 1.5px; text-transform: uppercase;
}

.prop-card-bars { display: flex; flex-direction: column; gap: 3px; }
.prop-card-bar-row { display: flex; align-items: center; gap: 4px; }
.prop-card-bar-label {
  font-size: 8px; color: var(--text-muted);
  min-width: 55px; text-transform: uppercase; letter-spacing: 0.3px;
}
.prop-card-bar-outer {
  flex: 1; height: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px; overflow: hidden;
}
.prop-card-bar-inner { height: 100%; border-radius: 2px; transition: width 0.3s ease; }
.prop-card-bar-score {
  font-size: 9px; color: var(--text-secondary);
  font-weight: 600; font-variant-numeric: tabular-nums;
  min-width: 18px; text-align: right;
}

/* ── Score Popup ─────────────────────────────── */
.score-popup { padding: 4px 2px; font-family: var(--font-mono); min-width: 220px; }
.score-popup-title { font-size: 13px; font-weight: 700; color: #fff; margin-bottom: 2px; }
.score-popup-meta { font-size: 10px; color: var(--text-secondary); margin-bottom: 4px; }
.score-popup-divider { height: 1px; background: rgba(0, 255, 136, 0.25); margin: 6px 0; }
.score-popup-total { display: flex; justify-content: space-between; align-items: center; padding: 2px 0; }
.score-popup-total span:first-child { font-size: 10px; color: var(--text-muted); letter-spacing: 1px; font-weight: 600; }
.score-popup-total-value { font-size: 18px; font-weight: 700; text-shadow: 0 0 12px currentColor; }

.score-popup-category { margin-bottom: 6px; }
.score-popup-cat-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 3px; }
.score-popup-cat-label { font-size: 11px; color: var(--text-secondary); font-weight: 600; }
.score-popup-cat-score { font-size: 12px; color: var(--accent-green); font-weight: 700; font-variant-numeric: tabular-nums; }

.score-bar-outer {
  height: 4px; background: rgba(255,255,255,0.08);
  border-radius: 2px; overflow: hidden; margin-bottom: 3px;
}
.score-bar-inner { height: 100%; border-radius: 2px; transition: width 0.3s ease; }

.score-popup-nearest { font-size: 9px; color: var(--text-muted); padding-left: 8px; }

/* ── Amenity Popup ───────────────────────────── */
.amenity-popup { padding: 4px 2px; font-family: var(--font-mono); }
.amenity-popup-name { font-size: 12px; font-weight: 600; color: #fff; margin-bottom: 2px; }
.amenity-popup-category { font-size: 10px; font-weight: 600; }
.amenity-popup-type { font-size: 9px; color: var(--text-muted); }

/* ── District Popup ──────────────────────────── */
.district-popup { padding: 4px 2px; font-family: var(--font-mono); min-width: 200px; }
.district-popup-name { font-size: 13px; font-weight: 700; color: #fff; letter-spacing: 0.5px; margin-bottom: 6px; }
.district-popup-divider { height: 1px; background: rgba(0, 255, 136, 0.25); margin: 6px 0; }
.district-popup-row { display: flex; justify-content: space-between; align-items: center; padding: 3px 0; font-size: 11px; }
.district-popup-label { color: var(--text-secondary); letter-spacing: 0.3px; }
.district-popup-value { color: var(--accent-green); font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(0, 255, 136, 0.2); }
.district-popup-section-title { font-size: 10px; font-weight: 700; color: var(--accent-cyan); letter-spacing: 1px; margin-bottom: 4px; text-shadow: 0 0 8px rgba(0, 212, 255, 0.2); }

/* ── Stats Section ───────────────────────────── */
.stats-section { margin-bottom: var(--space-md); }
.stats-title { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: var(--space-sm); }
.stat-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.03); font-size: 12px; }
.stat-label { color: var(--text-secondary); }
.stat-value { color: var(--accent-green); font-weight: 600; font-variant-numeric: tabular-nums; text-shadow: 0 0 8px rgba(0, 255, 136, 0.2); }

/* ── H3 Info ─────────────────────────────────── */
.h3-info { font-size: 10px; color: var(--text-muted); letter-spacing: 0.5px; padding: var(--space-xs) 0; margin-bottom: var(--space-sm); display: flex; align-items: center; gap: var(--space-sm); }
.h3-info-res { color: var(--accent-cyan); font-weight: 600; text-shadow: 0 0 8px rgba(0, 212, 255, 0.2); }

/* ── Legend ───────────────────────────────────── */
#legend { margin-top: auto; padding-top: var(--space-md); border-top: 1px solid var(--glass-border); }
.legend-title { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: var(--space-sm); }
.legend-item { display: flex; align-items: center; gap: var(--space-sm); font-size: 11px; color: var(--text-secondary); margin-bottom: var(--space-xs); }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; box-shadow: 0 0 6px currentColor; }
.legend-gradient { height: 10px; border-radius: 5px; margin-bottom: var(--space-xs); }
.legend-gradient.density { background: linear-gradient(to right, #00e676, #a5d6a7, #ffeb3b, #ffab40, #ff5252); }
.legend-gradient.score-heat { background: linear-gradient(to right, #ff5252, #ffab40, #ffeb3b, #a5d6a7, #00e676); }
.legend-gradient.desert-heat { background: linear-gradient(to right, #1a1a2e, #7b1fa2, #e040fb); }
.legend-labels { display: flex; justify-content: space-between; font-size: 10px; color: var(--text-muted); }
.legend-note { font-size: 10px; color: var(--text-muted); margin-top: var(--space-xs); font-style: italic; }

/* ── Map ─────────────────────────────────────── */
#map { position: absolute; inset: 0; z-index: var(--z-map); }

/* ── Leaflet Overrides ───────────────────────── */
/* District polygons: no click interception — let property markers above receive clicks */
.leaflet-districts-pane path { pointer-events: none; }
/* Properties pane: explicit pointer-events to ensure click capture above districts */
.leaflet-properties-pane { pointer-events: auto; }

.leaflet-popup-content-wrapper {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-glass) !important;
  font-family: var(--font-mono) !important;
}
.leaflet-popup-tip { background: var(--glass-bg) !important; }
.leaflet-popup-close-button { color: var(--text-muted) !important; font-size: 18px !important; }
.leaflet-popup-close-button:hover { color: var(--text-primary) !important; }

/* ── Hex Popup ───────────────────────────────── */
.hex-popup { padding: 4px 2px; font-family: var(--font-mono); min-width: 180px; }
.hex-popup-metric { font-size: 13px; font-weight: 700; color: var(--accent-green); letter-spacing: 0.3px; margin-bottom: 4px; text-shadow: 0 0 8px rgba(0, 255, 136, 0.2); }
.hex-popup-stats { font-size: 11px; color: var(--text-secondary); margin-bottom: 6px; padding-bottom: 6px; border-bottom: 1px solid rgba(0, 255, 136, 0.15); }
.hex-popup-list { max-height: 140px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--text-muted) transparent; }
.hex-popup-shop { font-size: 10px; color: var(--text-primary); padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; display: block; }
.hex-popup-more { font-size: 10px; color: var(--text-muted); font-style: italic; margin-top: 4px; }
.hex-cell { transition: fill-opacity 0.15s ease; }

/* ── Weight & Radius Sliders ─────────────────── */
.weight-sliders { display: flex; flex-direction: column; gap: 4px; }
.tuning-cat-header {
  display: flex; align-items: center; gap: 6px;
  font-size: 10px; font-weight: 600; color: var(--text-secondary);
  margin-top: 6px; padding-bottom: 2px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.tuning-cat-header:first-child { margin-top: 0; }
.tuning-cat-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.radius-slider-input::-webkit-slider-thumb { background: var(--accent-cyan) !important; box-shadow: 0 0 4px var(--accent-cyan) !important; }
.radius-slider-input::-moz-range-thumb { background: var(--accent-cyan) !important; box-shadow: 0 0 4px var(--accent-cyan) !important; }
.radius-slider-value { color: var(--accent-cyan) !important; }
.weight-slider-row { display: flex; align-items: center; gap: var(--space-sm); }
.weight-slider-label { font-size: 9px; color: var(--text-secondary); min-width: 70px; text-transform: uppercase; letter-spacing: 0.5px; }
.weight-slider-input {
  flex: 1; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.08); border-radius: 2px;
  outline: none; cursor: pointer;
}
.weight-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none; width: 12px; height: 12px;
  border-radius: 50%; background: var(--accent-green);
  box-shadow: 0 0 4px var(--accent-green); cursor: pointer;
}
.weight-slider-input::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent-green); box-shadow: 0 0 4px var(--accent-green);
  border: none; cursor: pointer;
}
.weight-slider-pct { font-size: 10px; color: var(--accent-green); font-weight: 600; min-width: 32px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Score Visualization (lines + highlighted markers) ── */
.score-viz-marker {
  background: none !important;
  border: none !important;
}
.score-viz-marker-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  border: 2px solid #fff;
  box-shadow: 0 0 12px currentColor, 0 0 24px rgba(255,255,255,0.2);
  animation: score-viz-pulse 2s ease-in-out infinite;
}
.score-viz-label {
  background: none !important;
  border: none !important;
  z-index: 1000 !important;
}
.score-viz-label-inner {
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  background: rgba(0,0,0,0.75);
  padding: 2px 6px;
  border-radius: 3px;
  letter-spacing: 0.3px;
}
@keyframes score-viz-pulse {
  0%, 100% { box-shadow: 0 0 8px currentColor; }
  50% { box-shadow: 0 0 16px currentColor, 0 0 28px rgba(255,255,255,0.15); }
}

/* ── Compare Checkbox in Property List ────────── */
.compare-checkbox {
  width: 14px; height: 14px; flex-shrink: 0;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

/* ── Comparison View ─────────────────────────── */
.compare-empty, .compare-hint {
  font-size: 11px; color: var(--text-muted); text-align: center;
  padding: var(--space-md);
}
.compare-selection {
  display: flex; flex-wrap: wrap; gap: var(--space-xs);
  margin-bottom: var(--space-md);
}
.compare-chip {
  display: flex; align-items: center; gap: 4px;
  padding: 4px 8px;
  background: var(--accent-cyan-dim);
  border: 1px solid rgba(0, 212, 255, 0.3);
  border-radius: var(--radius-sm);
  font-size: 10px; color: var(--accent-cyan);
}
.compare-chip-name {
  max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.compare-chip-remove {
  background: none; border: none; color: var(--accent-cyan);
  font-size: 13px; cursor: pointer; padding: 0 2px;
  opacity: 0.7; transition: opacity var(--transition-fast);
}
.compare-chip-remove:hover { opacity: 1; }

.compare-table {
  display: flex; flex-direction: column; gap: 2px;
}
.compare-row {
  display: flex; gap: 4px; align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.compare-header { border-bottom: 1px solid var(--glass-border); padding-bottom: 6px; margin-bottom: 2px; }
.compare-cell { flex: 1; min-width: 0; }
.compare-label {
  flex: 0 0 60px; font-size: 9px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.compare-prop-name {
  font-size: 9px; font-weight: 600; color: var(--text-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.compare-total-row { padding: 6px 0; }
.compare-score-value {
  font-size: 14px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.compare-winner { text-shadow: 0 0 10px currentColor; }

.compare-bar-outer {
  height: 4px; background: rgba(255,255,255,0.06);
  border-radius: 2px; overflow: hidden; margin-bottom: 2px;
}
.compare-bar-inner {
  height: 100%; border-radius: 2px;
  transition: width 0.3s ease;
}
.compare-bar-winner { box-shadow: 0 0 4px currentColor; }
.compare-cat-score {
  font-size: 10px; color: var(--text-secondary);
  font-weight: 600; font-variant-numeric: tabular-nums;
}
.compare-meta-row { border-bottom: none; }
.compare-meta-value {
  font-size: 10px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

/* ── Distance Ring Labels ───────────────────── */
.distance-ring-label {
  background: none !important;
  border: none !important;
}
.distance-ring-label-inner {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(0,0,0,0.6);
  padding: 1px 5px;
  border-radius: 3px;
  letter-spacing: 0.5px;
}

/* ── Animations ──────────────────────────────── */
@keyframes dot-pulse-green {
  0%, 100% { box-shadow: 0 0 4px var(--accent-green); }
  50% { box-shadow: 0 0 12px var(--accent-green), 0 0 20px rgba(0, 255, 136, 0.3); }
}
@keyframes dot-pulse-cyan {
  0%, 100% { box-shadow: 0 0 4px var(--accent-cyan); }
  50% { box-shadow: 0 0 12px var(--accent-cyan), 0 0 20px rgba(0, 212, 255, 0.3); }
}

/* ── Mobile: Bottom Drawer ───────────────────── */
@media (max-width: 768px) {
  #stats-ticker { height: 36px; min-height: 36px; }
  .ticker-chip { font-size: 10px; }
  .ticker-chip-label { font-size: 9px; }

  #sidebar {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0;
    width: 100%; max-height: 60px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    padding: 0 var(--space-md) var(--space-md);
    overflow: hidden; transition: max-height 0.3s ease;
  }
  #sidebar.expanded { max-height: 70vh; overflow-y: auto; }
  #sidebar-handle { display: flex; justify-content: center; padding: 10px 0 6px; cursor: pointer; }
  #sidebar-handle::before { content: ""; width: 40px; height: 4px; background: var(--text-muted); border-radius: 2px; }
  .sidebar-title { font-size: 14px; }
  .sidebar-subtitle { margin-bottom: var(--space-sm); }
  #map { position: relative; height: 100%; width: 100%; }
}
