/**
 * Casa de Sowu - Glass UI Styles
 * Visual styling ONLY - no page layout rules
 * Layout handled by page-layout.css
 */

/* ============================================
   CSS Variables - Theme
   ============================================ */
:root {
  /* Colors */
  --bg-primary: #050508;
  --bg-surface: rgba(20, 20, 28, 0.85);
  --bg-surface-hover: rgba(30, 30, 42, 0.9);
  --bg-card: rgba(25, 25, 35, 0.8);
  
  /* Glass effect */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  
  /* Text */
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.85);
  --text-muted: rgba(255, 255, 255, 0.5);
  
  /* Accents */
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-cyan: #22d3ee;
  --accent-green: #22c55e;
  --accent-orange: #f97316;
  --accent-red: #ef4444;
  --accent-yellow: #eab308;
  
  /* Gradients */
  --gradient-purple: linear-gradient(135deg, #8b5cf6, #ec4899);
  --gradient-cyan: linear-gradient(135deg, #22d3ee, #8b5cf6);
  --gradient-warm: linear-gradient(135deg, #f97316, #ec4899);
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  
  /* Border radius */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  
  /* Safe areas */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ============================================
   Base Styles
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100%;
}

body {
  background: 
    radial-gradient(ellipse at 20% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(236, 72, 153, 0.1) 0%, transparent 50%),
    var(--bg-primary);
}

#app {
  height: 100%;
}

/* ============================================
   Setup Screen
   ============================================ */
.setup-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--space-lg);
}

.setup-screen.hidden {
  display: none;
}

.setup-container {
  max-width: 400px;
  width: 100%;
  padding: var(--space-xl);
  text-align: center;
}

.setup-logo .mdi {
  font-size: 4rem;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.setup-container h1 {
  font-size: 1.75rem;
  font-weight: 600;
  margin: var(--space-md) 0 var(--space-sm);
}

.setup-container p {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.advanced-setup {
  margin-top: var(--space-lg);
  text-align: left;
}

.advanced-setup summary {
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.input-group {
  margin: var(--space-md) 0;
}

.input-group label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.input-group input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 1rem;
}

.input-group input:focus {
  outline: none;
  border-color: var(--accent-purple);
}

.login-status {
  margin-top: var(--space-md);
  font-size: 0.875rem;
  color: var(--accent-red);
}

/* ============================================
   Buttons
   ============================================ */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  background: var(--gradient-purple);
  border: none;
  border-radius: var(--radius-full);
  color: white;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.875rem;
  cursor: pointer;
  transition: background 0.2s;
  width: 100%;
  margin-top: var(--space-sm);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
}

/* ============================================
   Main App Container
   ============================================ */
.main-app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
}

.main-app.hidden {
  display: none;
}

/* ============================================
   Connection Banner
   ============================================ */
.connection-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--accent-red);
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
}

.connection-banner.hidden {
  display: none;
}

/* ============================================
   Dynamic Island Header
   ============================================ */
.dynamic-island {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  padding-top: calc(var(--space-md) + var(--safe-top));
  flex-shrink: 0;
}

.island-left,
.island-right {
  font-size: 0.875rem;
  color: var(--text-muted);
}

.island-center {
  flex: 1;
  text-align: center;
}

.island-greeting {
  font-size: 1.125rem;
  font-weight: 500;
  background: var(--gradient-purple);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============================================
   Navigation Pills
   ============================================ */
.nav-pills {
  display: flex;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  flex-shrink: 0;
  justify-content: center;
}

.nav-pills::-webkit-scrollbar {
  display: none;
}

.nav-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  background: transparent;
  border: none;
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.nav-pill .mdi {
  font-size: 1.25rem;
}

.nav-pill:hover {
  color: var(--text-secondary);
  background: var(--bg-surface);
}

.nav-pill.active {
  color: white;
  background: var(--gradient-purple);
}

/* ============================================
   Glass Card
   ============================================ */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
}

/* ============================================
   Section Headers
   ============================================ */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
  background: var(--gradient-purple);
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.9rem;
}

.section-header .mdi {
  font-size: 1.125rem;
}

/* ============================================
   Device Grid & Cards
   ============================================ */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--space-md);
}

.device-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-lg) var(--space-md);
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 140px;
}

.device-card:hover {
  background: var(--bg-surface-hover);
  transform: translateY(-2px);
}

.device-card.active {
  border-color: var(--accent-purple);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

.device-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
  color: var(--text-muted);
  transition: color 0.2s;
}

.device-card.active .device-icon {
  color: var(--accent-yellow);
}

.device-card.fan .device-icon {
  color: var(--accent-cyan);
}

.device-name {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: var(--space-xs);
}

.device-status {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ============================================
   Family Cards & Map
   ============================================ */
.family-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.family-card {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
}

.family-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.25rem;
  color: white;
  flex-shrink: 0;
}

.family-info {
  flex: 1;
  min-width: 0;
}

.family-name {
  font-weight: 500;
  margin-bottom: var(--space-xs);
}

.family-location {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.family-address {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.family-travel {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.family-battery {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  font-size: 0.75rem;
  color: var(--accent-green);
}

.map-container {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

#family-map {
  width: 100%;
  height: 100%;
  background: var(--bg-surface);
}

.map-controls {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 1000;
  display: flex;
  gap: var(--space-xs);
}

.map-controls button {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   Camera Grid
   ============================================ */
.camera-featured {
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.camera-stream {
  position: relative;
  background: var(--bg-surface);
}

.camera-stream img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-label {
  position: absolute;
  bottom: var(--space-sm);
  left: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  background: rgba(0, 0, 0, 0.7);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
}

.camera-loading,
.camera-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: var(--bg-surface);
  color: var(--text-muted);
}

.camera-loading.hidden,
.camera-error.hidden {
  display: none;
}

.camera-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}

.camera-thumb {
  aspect-ratio: 16/9;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  cursor: pointer;
}

.camera-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   Media Player
   ============================================ */
.media-player {
  text-align: center;
}

.album-art {
  width: 200px;
  height: 200px;
  margin: 0 auto var(--space-lg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--gradient-purple);
  display: flex;
  align-items: center;
  justify-content: center;
}

.album-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.album-art .mdi {
  font-size: 4rem;
  color: rgba(255, 255, 255, 0.5);
}

.track-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.track-artist {
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

.playback-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.playback-controls button {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: var(--space-sm);
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.playback-controls button:hover {
  background: var(--bg-surface);
}

.playback-controls .mdi {
  font-size: 1.5rem;
}

.play-btn {
  width: 56px;
  height: 56px;
  background: var(--gradient-purple) !important;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-btn .mdi {
  font-size: 2rem;
}

.progress-container {
  margin-bottom: var(--space-md);
}

.progress-bar {
  height: 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
  cursor: pointer;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-purple);
  width: 0%;
  transition: width 0.1s;
}

.progress-time {
  display: flex;
  justify-content: flex-end;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.volume-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.volume-container .mdi {
  color: var(--text-muted);
}

.volume-slider {
  width: 120px;
  height: 4px;
  background: var(--bg-surface);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.volume-fill {
  height: 100%;
  background: var(--accent-green);
  width: 50%;
}

.speaker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.speaker-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.speaker-item:hover {
  background: var(--bg-surface-hover);
}

.speaker-item.active {
  border-color: var(--accent-purple);
  background: rgba(139, 92, 246, 0.2);
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: var(--space-sm);
}

.playlist-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 0.75rem;
  text-align: center;
  transition: all 0.2s;
}

.playlist-item:hover {
  background: var(--bg-surface-hover);
}

.playlist-item .mdi {
  font-size: 1.5rem;
  color: var(--accent-purple);
}

/* ============================================
   Calendar
   ============================================ */
.calendar-events,
.calendar-week {
  max-height: 250px;
  overflow-y: auto;
  margin-bottom: var(--space-lg);
}

.calendar-event {
  padding: var(--space-sm) var(--space-md);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  border-left: 3px solid var(--accent-purple);
  margin-bottom: var(--space-sm);
}

.event-time {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.event-title {
  font-size: 0.9rem;
  font-weight: 500;
  margin: var(--space-xs) 0;
}

.event-calendar {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.no-events,
.no-tasks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg);
  color: var(--text-muted);
  font-size: 0.9rem;
}

.tasks-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.todo-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm);
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
}

.todo-item.completed {
  opacity: 0.5;
  text-decoration: line-through;
}

/* ============================================
   Weather / Climate
   ============================================ */
.weather-current {
  text-align: center;
  padding: var(--space-lg);
}

.weather-temp {
  font-size: 3rem;
  font-weight: 300;
}

.weather-condition {
  color: var(--text-muted);
}

.weather-grid,
.room-temps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-md);
}

/* ============================================
   Magic FAB
   ============================================ */
.magic-fab {
  position: fixed;
  bottom: calc(var(--space-lg) + var(--safe-bottom));
  right: var(--space-lg);
  width: 56px;
  height: 56px;
  border-radius: var(--radius-full);
  background: var(--gradient-purple);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 100;
}

.magic-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(139, 92, 246, 0.6);
}

/* Claude FAB — bottom-left */
.claude-fab {
  position: fixed;
  bottom: calc(var(--space-lg) + var(--safe-bottom));
  left: var(--space-lg);
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #cc785c 0%, #a85a3e 100%);
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(204, 120, 92, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 100;
}

.claude-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 24px rgba(204, 120, 92, 0.7);
}

/* ============================================
   Utilities
   ============================================ */
.hidden {
  display: none !important;
}

.mdi-spin {
  animation: spin 1s linear infinite;
}

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

/* ============================================
   Scrollbar Styling
   ============================================ */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* =========================================
   T1003: CONTENT CONTAINMENT (SAFETY RAILS)
   ========================================= */

/* GLOBAL SAFETY: Never allow horizontal overflow on any page content */
.page-content {
  width: 100% !important;
  max-width: 100% !important; /* Relative to the 100vw page */
  box-sizing: border-box !important;
  overflow-x: hidden !important; /* Cut off anything that sticks out */
  padding-left: 20px !important; /* Ensure safe edges */
  padding-right: 20px !important;
}

/* --- FAMILY PAGE FIXES --- */
#page-family .map-container {
  width: 100% !important;
  max-width: 100% !important;
  border-radius: 16px;
  overflow: hidden !important; /* Critical for Leaflet maps */
  
  /* Reset margins to prevent push */
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Leaflet specific fix */
.leaflet-container {
  width: 100% !important;
  max-width: 100% !important;
}

/* --- CAMERA PAGE FIXES --- */
#page-cameras .camera-grid,
#page-cameras .camera-featured {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

/* Ensure images/video scale down, never push out */
img, video, .camera-feed {
  max-width: 100% !important;
  height: auto !important;
  object-fit: cover;
}

/* --- MEDIA PAGE FIXES --- */
#page-media .media-player {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
}

/* Prevent Album Art blowout */
.media-art-container {
  max-width: 100% !important;
  overflow: hidden !important;
}

/* T1006: MAP RESURRECTION */

#page-family .map-container {
  /* Enforce physical presence */
  display: block !important;
  width: 100% !important;
  height: 50vh !important; /* Use 50% of screen height */
  min-height: 400px !important; /* Never smaller than this */
  
  /* Ensure it is visible */
  opacity: 1 !important;
  visibility: visible !important;
  
  /* Retain styling */
  border-radius: 16px;
  overflow: hidden !important;
  margin-top: 20px !important;
  position: relative !important;
  z-index: 1 !important;
}

#map {
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
}

#family-map {
  width: 100% !important;
  height: 100% !important;
  z-index: 0 !important;
}

/* T1007: MAP BUFFER ZONE */

#page-family .map-container {
  /* 1. Size: 6/8ths (75%) width */
  width: 75% !important;
  max-width: 800px !important; /* Cap it for large screens */
  
  /* 2. Positioning: Centered horizontally */
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 20px !important;
  
  /* 3. Height: Keep existing height logic */
  height: 50vh !important;
  min-height: 400px !important;
  
  /* 4. Visuals */
  border-radius: 20px !important; /* Slightly rounder for the island look */
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important; /* Lift it up */
  
  /* 5. Containment */
  overflow: hidden !important;
  display: block !important;
  visibility: visible !important;
}

/* Ensure the map object inside fills the new smaller container */
#family-map, #map {
  width: 100% !important;
  height: 100% !important;
}

/* T1007: FINAL FAMILY CONTAINMENT */

/* 1. The Family Grid Container (Person Tiles) */
.family-grid {
  /* Constrain width so it never touches edges */
  width: 90% !important;
  max-width: 800px !important; /* Cap for desktop */
  
  /* Center the grid block */
  margin-left: auto !important;
  margin-right: auto !important;
  margin-bottom: 20px !important;
  
  /* Layout Internals */
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important; /* Center cards within grid */
  gap: 12px !important;
  
  padding: 0 !important;
  box-sizing: border-box !important;
}

/* 2. The Individual Person Cards */
.family-card {
  /* Fixed sizing logic: Don't grow massive, don't shrink to zero */
  flex: 0 1 160px !important; /* Grow: 0, Shrink: 1, Basis: 160px */
  
  /* Strict limits */
  min-width: 130px !important;
  max-width: 180px !important;
  
  /* Visuals */
  height: auto !important;
  aspect-ratio: 1.5 / 1 !important; /* nice rectangular shape */
}

/* 3. The Map Container (Buffer Zone) */
#page-family .map-container {
  /* Size: 85% width (Safety Buffer) */
  width: 85% !important;
  max-width: 600px !important;
  
  /* Center it */
  margin-left: auto !important;
  margin-right: auto !important;
  margin-top: 10px !important;
  
  /* Height */
  height: 45vh !important;
  min-height: 350px !important;
  
  /* Visuals */
  border-radius: 20px !important;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3) !important;
  
  /* Containment */
  overflow: hidden !important;
  display: block !important;
  visibility: visible !important;
}

/* Ensure map fills the container */
#family-map, #map {
  width: 100% !important;
  height: 100% !important;
}
