/**
 * MLS Property Desktop V3 Styles
 * Modern homes.com-inspired design with full-width gallery
 * 
 * @version 3.0.0
 */

/* ========================================
   CSS Variables
   ======================================== */
:root {
    /* Colors - Modern palette */
    --v3-primary: #006AFF;
    --v3-primary-hover: #0052CC;
    --v3-secondary: #64748B;
    --v3-success: #22C55E;
    --v3-danger: #EF4444;
    --v3-warning: #F59E0B;
    
    --v3-background: #FFFFFF;
    --v3-surface: #F8FAFC;
    --v3-surface-hover: #F1F5F9;
    --v3-border: #E2E8F0;
    --v3-border-hover: #CBD5E1;
    
    --v3-text-primary: #0F172A;
    --v3-text-secondary: #475569;
    --v3-text-tertiary: #94A3B8;
    --v3-text-inverse: #FFFFFF;
    
    /* Shadows */
    --v3-shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
    --v3-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --v3-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --v3-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    
    /* Spacing */
    --v3-spacing-xs: 0.5rem;
    --v3-spacing-sm: 0.75rem;
    --v3-spacing-md: 1rem;
    --v3-spacing-lg: 1.5rem;
    --v3-spacing-xl: 2rem;
    --v3-spacing-2xl: 3rem;
    --v3-spacing-3xl: 4rem;
    
    /* Border Radius */
    --v3-radius-sm: 0.375rem;
    --v3-radius-md: 0.5rem;
    --v3-radius-lg: 0.75rem;
    --v3-radius-xl: 1rem;
    --v3-radius-full: 9999px;
    
    /* Layout */
    --v3-container-max: 1440px;
    --v3-content-max: 1200px;
    --v3-nav-height: 60px;
    --v3-gallery-height: 600px;
}

/* ========================================
   Base Styles
   ======================================== */
.mld-v3-property {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: var(--v3-text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Ensure sticky works by not setting overflow on parent */
    overflow-x: visible;
}

.mld-v3-property * {
    box-sizing: border-box;
}

/* ========================================
   Hero Gallery
   ======================================== */
.mld-v3-hero-gallery {
    position: relative;
    width: 100%;
    height: var(--v3-gallery-height);
    background: var(--v3-text-primary);
    overflow: hidden;
}

.mld-v3-gallery-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.mld-v3-gallery-main {
    position: relative;
    width: 100%;
    height: 100%;
}

.mld-v3-gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.mld-v3-gallery-image.active {
    opacity: 1;
}

/* Gallery View Modes */
.mld-v3-gallery-map,
.mld-v3-gallery-streetview,
.mld-v3-gallery-tour {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 5;
}

.mld-v3-gallery-map.active,
.mld-v3-gallery-streetview.active,
.mld-v3-gallery-tour.active {
    display: block;
}

.mld-v3-gallery-map iframe,
.mld-v3-gallery-streetview iframe,
.mld-v3-gallery-tour iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Virtual Tour Loading State */
.mld-v3-gallery-tour:not(.loaded)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(59, 130, 246, 0.3);
    border-top-color: var(--v3-primary);
    border-radius: 50%;
    animation: mld-v3-spin 0.8s linear infinite;
}

@keyframes mld-v3-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.mld-v3-gallery-tour iframe {
    animation: mld-v3-fadeIn 0.5s ease;
}

@keyframes mld-v3-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Gallery Overlay */
.mld-v3-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0,0,0,0.3) 0%, transparent 30%, transparent 70%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

/* Gallery Navigation */
.mld-v3-gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: var(--v3-radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--v3-shadow-lg);
    transition: all 0.2s ease;
    pointer-events: all;
    z-index: 10;
    color: var(--v3-text-primary);
}

.mld-v3-gallery-nav:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.05);
}

.mld-v3-gallery-nav.prev {
    left: var(--v3-spacing-lg);
}

.mld-v3-gallery-nav.next {
    right: var(--v3-spacing-lg);
}

.mld-v3-gallery-nav svg {
    width: 24px;
    height: 24px;
    stroke-width: 2.5;
    stroke: currentColor;
}

/* Gallery Actions */
.mld-v3-gallery-actions {
    position: absolute;
    bottom: var(--v3-spacing-lg);
    right: var(--v3-spacing-lg);
    display: flex;
    gap: var(--v3-spacing-sm);
    pointer-events: all;
    z-index: 10;
}

.mld-v3-gallery-action {
    display: flex;
    align-items: center;
    gap: var(--v3-spacing-xs);
    padding: var(--v3-spacing-sm) var(--v3-spacing-md);
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: var(--v3-radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--v3-text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: var(--v3-shadow-md);
}

.mld-v3-gallery-action:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
    box-shadow: var(--v3-shadow-lg);
}

.mld-v3-gallery-action svg {
    width: 18px;
    height: 18px;
}

.mld-v3-gallery-action.active {
    background: var(--v3-primary);
    color: var(--v3-text-inverse);
}

/* Virtual Tour Button Variations */
.mld-v3-virtual-tour-btn[data-tour-type="matterport"] {
    background: rgba(255, 255, 255, 0.95);
}

.mld-v3-virtual-tour-btn[data-tour-type="matterport"]:hover {
    background: #E0F2FE;
    color: #0369A1;
}

.mld-v3-virtual-tour-btn[data-tour-type="matterport"].active {
    background: #0284C7;
    color: white;
}

.mld-v3-virtual-tour-btn[data-tour-type="youtube"],
.mld-v3-virtual-tour-btn[data-tour-type="vimeo"] {
    background: rgba(255, 255, 255, 0.95);
}

.mld-v3-virtual-tour-btn[data-tour-type="youtube"]:hover,
.mld-v3-virtual-tour-btn[data-tour-type="vimeo"]:hover {
    background: #FEF2F2;
    color: #991B1B;
}

.mld-v3-virtual-tour-btn[data-tour-type="youtube"].active,
.mld-v3-virtual-tour-btn[data-tour-type="vimeo"].active {
    background: #DC2626;
    color: white;
}

/* No Photos State */
.mld-v3-no-photos {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: var(--v3-surface);
    color: var(--v3-text-tertiary);
}

.mld-v3-no-photos svg {
    width: 64px;
    height: 64px;
    margin-bottom: var(--v3-spacing-md);
    opacity: 0.3;
}

/* ========================================
   Sticky Navigation Bar
   ======================================== */
.mld-v3-nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--v3-background);
    border-bottom: 1px solid var(--v3-border);
    box-shadow: var(--v3-shadow-sm);
}

.mld-v3-nav-bar.scrolled {
    box-shadow: var(--v3-shadow-md);
}

.mld-v3-nav-container {
    max-width: var(--v3-content-max);
    margin: 0 auto;
    padding: 0 var(--v3-spacing-lg);
    height: var(--v3-nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mld-v3-nav-links {
    display: flex;
    gap: var(--v3-spacing-xl);
    height: 100%;
}

.mld-v3-nav-link {
    display: flex;
    align-items: center;
    padding: 0 var(--v3-spacing-xs);
    color: var(--v3-text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9375rem;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
}

.mld-v3-nav-link:hover {
    color: var(--v3-text-primary);
}

.mld-v3-nav-link.active {
    color: var(--v3-primary);
    border-bottom-color: var(--v3-primary);
}

.mld-v3-nav-actions {
    display: flex;
    gap: var(--v3-spacing-sm);
}

.mld-v3-nav-action {
    display: flex;
    align-items: center;
    gap: var(--v3-spacing-xs);
    padding: var(--v3-spacing-sm) var(--v3-spacing-md);
    background: transparent;
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius-md);
    color: var(--v3-text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mld-v3-nav-action:hover {
    background: var(--v3-surface);
    border-color: var(--v3-border-hover);
}

.mld-v3-nav-action svg {
    width: 18px;
    height: 18px;
}

.mld-v3-nav-action.saved {
    background: var(--v3-primary);
    color: var(--v3-text-inverse);
    border-color: var(--v3-primary);
}

/* ========================================
   Main Content Layout
   ======================================== */
.mld-v3-content {
    position: relative;
    max-width: var(--v3-content-max);
    margin: 0 auto;
    padding: var(--v3-spacing-2xl) var(--v3-spacing-lg) var(--v3-spacing-3xl);
    display: grid;
    grid-template-columns: 1fr 360px;
    gap: var(--v3-spacing-2xl);
    align-items: start;
}

.mld-v3-main {
    min-width: 0;
    min-height: 100vh; /* Ensure enough height for sticky sidebar */
}

/* ========================================
   Sections
   ======================================== */
.mld-v3-section {
    margin-bottom: var(--v3-spacing-3xl);
    scroll-margin-top: calc(var(--v3-nav-height) + var(--v3-spacing-lg));
}

.mld-v3-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 var(--v3-spacing-lg) 0;
    color: var(--v3-text-primary);
}

.mld-v3-section h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 var(--v3-spacing-md) 0;
    color: var(--v3-text-primary);
}

/* ========================================
   Property Header
   ======================================== */
.mld-v3-property-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--v3-spacing-xl);
    margin-bottom: var(--v3-spacing-xl);
}

.mld-v3-header-main {
    flex: 1;
    min-width: 0;
}

.mld-v3-address {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 var(--v3-spacing-xs) 0;
    color: var(--v3-text-primary);
    line-height: 1.2;
}

.mld-v3-location {
    font-size: 1.125rem;
    color: var(--v3-text-secondary);
}

.mld-v3-neighborhood {
    color: var(--v3-text-tertiary);
}

.mld-v3-header-price {
    text-align: right;
}

.mld-v3-price {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--v3-text-primary);
    line-height: 1;
}

.mld-v3-monthly {
    font-size: 1rem;
    color: var(--v3-text-secondary);
    margin-top: var(--v3-spacing-xs);
}

/* ========================================
   Stats Bar
   ======================================== */
.mld-v3-stats-bar {
    display: flex;
    gap: var(--v3-spacing-xl);
    padding: var(--v3-spacing-lg) 0;
    border-top: 1px solid var(--v3-border);
    border-bottom: 1px solid var(--v3-border);
    margin-bottom: var(--v3-spacing-lg);
    flex-wrap: wrap;
}

.mld-v3-stat {
    display: flex;
    flex-direction: column;
    gap: var(--v3-spacing-xs);
}

.mld-v3-stat-value {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--v3-text-primary);
}

.mld-v3-stat-label {
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
}

/* ========================================
   Status Bar & Tags
   ======================================== */
.mld-v3-status-bar {
    display: flex;
    align-items: center;
    gap: var(--v3-spacing-md);
    margin-bottom: var(--v3-spacing-xl);
    font-size: 0.875rem;
    flex-wrap: wrap;
}

.mld-v3-status,
.mld-v3-tag {
    padding: var(--v3-spacing-xs) var(--v3-spacing-sm);
    border-radius: var(--v3-radius-sm);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

.mld-v3-status.active {
    background: var(--v3-success);
    color: var(--v3-text-inverse);
}

.mld-v3-status.pending,
.mld-v3-status.active-under-contract {
    background: var(--v3-warning);
    color: var(--v3-text-inverse);
}

.mld-v3-status.closed {
    background: var(--v3-danger);
    color: var(--v3-text-inverse);
}

.mld-v3-tag {
    background: var(--v3-surface);
    color: var(--v3-text-primary);
    border: 1px solid var(--v3-border);
}

.mld-v3-tag.price-drop {
    background: #FEE2E2;
    color: #991B1B;
    border-color: #FCA5A5;
}

.mld-v3-tag.open-house {
    background: #DBEAFE;
    color: #1E40AF;
    border-color: #93C5FD;
}

.mld-v3-tag.new-listing {
    background: #D1FAE5;
    color: #065F46;
    border-color: #6EE7B7;
}

.mld-v3-listing-info {
    color: var(--v3-text-tertiary);
}

/* ========================================
   Description
   ======================================== */
.mld-v3-description {
    margin-bottom: var(--v3-spacing-2xl);
}

.mld-v3-description p {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--v3-text-secondary);
    margin: 0;
}

/* ========================================
   Open Houses
   ======================================== */
.mld-v3-open-houses {
    background: var(--v3-surface);
    padding: var(--v3-spacing-lg);
    border-radius: var(--v3-radius-lg);
    margin-bottom: var(--v3-spacing-2xl);
}

.mld-v3-open-house-list {
    display: flex;
    gap: var(--v3-spacing-md);
    flex-wrap: wrap;
}

.mld-v3-open-house-item {
    display: flex;
    gap: var(--v3-spacing-md);
    padding: var(--v3-spacing-md);
    background: var(--v3-background);
    border-radius: var(--v3-radius-md);
    box-shadow: var(--v3-shadow-sm);
}

.mld-v3-oh-date {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--v3-primary);
    color: var(--v3-text-inverse);
    border-radius: var(--v3-radius-md);
}

.mld-v3-oh-day {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
}

.mld-v3-oh-month {
    font-size: 0.75rem;
    text-transform: uppercase;
}

.mld-v3-oh-details {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.mld-v3-oh-dayname {
    font-weight: 600;
    color: var(--v3-text-primary);
}

.mld-v3-oh-time {
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
}

.mld-v3-oh-calendar {
    margin-left: auto;
}

.mld-v3-oh-calendar button {
    padding: var(--v3-spacing-xs) var(--v3-spacing-sm);
    background: var(--v3-primary);
    color: var(--v3-text-inverse);
    border: none;
    border-radius: var(--v3-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: var(--v3-spacing-xs);
}

.mld-v3-oh-calendar button:hover {
    background: var(--v3-primary-hover);
    transform: translateY(-1px);
}

.mld-v3-oh-calendar svg {
    width: 14px;
    height: 14px;
}

/* ========================================
   Facts & Features
   ======================================== */
.mld-v3-facts-group {
    margin-bottom: var(--v3-spacing-2xl);
    padding: var(--v3-spacing-lg);
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
}

.mld-v3-facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--v3-spacing-lg);
}

.mld-v3-fact-item {
    display: flex;
    flex-direction: column;
    gap: var(--v3-spacing-xs);
}

.mld-v3-fact-label {
    font-size: 0.875rem;
    color: var(--v3-text-tertiary);
}

.mld-v3-fact-value {
    font-weight: 600;
    color: var(--v3-text-primary);
}

/* Admin Only Section Styles */
.mld-v3-admin-only {
    background-color: #fff8dc;
    border: 2px solid #ffd700;
    position: relative;
}

/* Admin Section at Top */
.mld-v3-admin-section {
    margin-top: var(--v3-spacing-xl);
    margin-bottom: var(--v3-spacing-xl);
}

/* Admin Header with Toggle Button */
.mld-v3-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.mld-v3-admin-header h3 {
    margin: 0;
}

.mld-v3-admin-toggle {
    background: transparent;
    border: 1px solid #ffd700;
    padding: 6px;
    cursor: pointer;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.mld-v3-admin-toggle:hover {
    background-color: #ffd700;
}

.mld-v3-admin-toggle-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

/* Minimized State */
.mld-v3-admin-section.minimized .mld-v3-admin-content {
    display: none;
}

.mld-v3-admin-section.minimized .mld-v3-admin-notice {
    display: none;
}

.mld-v3-admin-section.minimized .mld-v3-admin-toggle-icon {
    transform: rotate(180deg);
}

.mld-v3-admin-section.minimized {
    margin-bottom: var(--v3-spacing-md);
}

/* Admin Content */
.mld-v3-admin-content {
    transition: all 0.3s ease;
}

.mld-v3-admin-notice {
    background-color: #ffd700;
    color: #333;
    padding: 10px 15px;
    margin: -20px -20px 20px -20px;
    font-weight: 600;
    text-align: center;
    border-radius: 8px 8px 0 0;
}

.mld-v3-admin-only .mld-v3-facts-grid {
    background-color: transparent;
}

.mld-v3-admin-only .mld-v3-fact-item {
    background-color: rgba(255, 255, 255, 0.7);
}

/* Full width items for text blocks */
.mld-v3-fact-item-full {
    grid-column: 1 / -1;
}

.mld-v3-text-block {
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    padding: 10px;
    background-color: var(--v3-surface);
    border-radius: var(--v3-radius-sm);
    margin-top: 5px;
}

/* Rooms List */
.mld-v3-rooms-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--v3-spacing-md);
}

.mld-v3-room-item {
    padding: var(--v3-spacing-md);
    background: var(--v3-background);
    border-radius: var(--v3-radius-md);
    border: 1px solid var(--v3-border);
}

.mld-v3-room-name {
    font-weight: 600;
    color: var(--v3-text-primary);
    margin-bottom: var(--v3-spacing-xs);
}

.mld-v3-room-details {
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
}

.mld-v3-room-details span {
    margin-right: var(--v3-spacing-md);
}

/* ========================================
   Location Section
   ======================================== */
.mld-v3-map-container {
    height: 400px;
    border-radius: var(--v3-radius-lg);
    overflow: hidden;
    margin-bottom: var(--v3-spacing-xl);
    position: relative;
    background: var(--v3-surface);
}

.mld-v3-map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--v3-text-tertiary);
}

.mld-v3-neighborhood-info,
.mld-v3-walk-score,
.mld-v3-nearby-places {
    margin-bottom: var(--v3-spacing-xl);
}

.mld-v3-neighborhood-details {
    padding: var(--v3-spacing-lg);
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
}

.mld-v3-nearby-placeholder {
    padding: var(--v3-spacing-xl);
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
    text-align: center;
    color: var(--v3-text-tertiary);
}

/* ========================================
   Schools Section
   ======================================== */
.mld-v3-schools-list {
    display: flex;
    flex-direction: column;
    gap: var(--v3-spacing-md);
}

.mld-v3-school-item {
    display: flex;
    gap: var(--v3-spacing-md);
    padding: var(--v3-spacing-lg);
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
    transition: all 0.2s ease;
}

.mld-v3-school-item:hover {
    box-shadow: var(--v3-shadow-sm);
}

.mld-v3-school-icon {
    width: 48px;
    height: 48px;
    background: var(--v3-primary);
    color: var(--v3-text-inverse);
    border-radius: var(--v3-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mld-v3-school-icon svg {
    width: 24px;
    height: 24px;
}

.mld-v3-school-details {
    flex: 1;
}

.mld-v3-school-level {
    font-size: 0.875rem;
    color: var(--v3-text-tertiary);
    margin-bottom: var(--v3-spacing-xs);
}

.mld-v3-school-name {
    font-weight: 600;
    color: var(--v3-text-primary);
    margin-bottom: var(--v3-spacing-xs);
}

.mld-v3-school-rating {
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
}

/* ========================================
   Payment Calculator
   ======================================== */
.mld-v3-calculator {
    background: var(--v3-surface);
    padding: var(--v3-spacing-xl);
    border-radius: var(--v3-radius-lg);
}

.mld-v3-calc-inputs {
    margin-bottom: var(--v3-spacing-xl);
}

.mld-v3-calc-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--v3-spacing-lg);
    margin-bottom: var(--v3-spacing-lg);
}

.mld-v3-calc-field label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--v3-spacing-sm);
    color: var(--v3-text-primary);
}

.mld-v3-calc-field input,
.mld-v3-calc-field select {
    width: 100%;
    padding: var(--v3-spacing-sm) var(--v3-spacing-md);
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius-md);
    font-size: 0.9375rem;
    transition: all 0.2s ease;
}

.mld-v3-calc-field select {
    padding-right: var(--v3-spacing-xl);
    font-size: 0.875rem;
    line-height: 1.4;
}

.mld-v3-calc-field input:focus,
.mld-v3-calc-field select:focus {
    outline: none;
    border-color: var(--v3-primary);
    box-shadow: 0 0 0 3px rgba(0, 106, 255, 0.1);
}

.mld-v3-calc-input-group {
    position: relative;
}

.mld-v3-calc-suffix {
    position: absolute;
    right: var(--v3-spacing-md);
    top: 50%;
    transform: translateY(-50%);
    color: var(--v3-text-tertiary);
    pointer-events: none;
}

.mld-v3-calc-secondary {
    margin-top: var(--v3-spacing-sm);
    background: var(--v3-background);
}

/* Calculator Results */
.mld-v3-calc-results {
    padding: var(--v3-spacing-xl);
    background: var(--v3-background);
    border-radius: var(--v3-radius-lg);
}

.mld-v3-calc-payment {
    text-align: center;
    margin-bottom: var(--v3-spacing-xl);
    padding-bottom: var(--v3-spacing-xl);
    border-bottom: 1px solid var(--v3-border);
}

.mld-v3-calc-payment span {
    display: block;
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
    margin-bottom: var(--v3-spacing-sm);
}

.mld-v3-calc-payment strong {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--v3-primary);
}

.mld-v3-calc-breakdown h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 var(--v3-spacing-md) 0;
}

.mld-v3-calc-item {
    display: flex;
    justify-content: space-between;
    padding: var(--v3-spacing-sm) 0;
    border-bottom: 1px solid var(--v3-border);
}

.mld-v3-calc-item:last-child {
    border-bottom: none;
}

/* ========================================
   History Tables
   ======================================== */
.mld-v3-history-group {
    margin-bottom: var(--v3-spacing-xl);
}

.mld-v3-history-table {
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
    overflow: hidden;
}

.mld-v3-history-table table {
    width: 100%;
    border-collapse: collapse;
}

.mld-v3-history-table th {
    padding: var(--v3-spacing-md);
    background: var(--v3-background);
    font-weight: 600;
    text-align: left;
    color: var(--v3-text-primary);
    font-size: 0.875rem;
}

.mld-v3-history-table td {
    padding: var(--v3-spacing-md);
    border-top: 1px solid var(--v3-border);
    color: var(--v3-text-secondary);
}

.mld-v3-price-change.negative {
    color: var(--v3-danger);
}

.mld-v3-no-data {
    text-align: center;
    color: var(--v3-text-tertiary);
    font-style: italic;
}

/* Market Statistics */
.mld-v3-market-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--v3-spacing-lg);
    padding: var(--v3-spacing-lg);
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
}

.mld-v3-stat-item {
    text-align: center;
    padding: var(--v3-spacing-md);
}

.mld-v3-stat-label {
    font-size: 0.875rem;
    color: var(--v3-text-tertiary);
    margin-bottom: var(--v3-spacing-sm);
}

.mld-v3-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--v3-text-primary);
}

/* ========================================
   Financial Details
   ======================================== */
.mld-v3-financial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--v3-spacing-lg);
}

.mld-v3-financial-item {
    padding: var(--v3-spacing-lg);
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
    text-align: center;
}

.mld-v3-financial-label {
    font-size: 0.875rem;
    color: var(--v3-text-tertiary);
    margin-bottom: var(--v3-spacing-sm);
}

.mld-v3-financial-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--v3-text-primary);
}

.mld-v3-financial-note {
    font-size: 0.75rem;
    color: var(--v3-text-secondary);
    margin-top: var(--v3-spacing-xs);
}

/* ========================================
   Similar Homes Placeholder
   ======================================== */
.mld-v3-similar-placeholder {
    padding: var(--v3-spacing-3xl);
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
    text-align: center;
    color: var(--v3-text-tertiary);
}

/* ========================================
   Listing Agent Section
   ======================================== */
.mld-v3-listing-agent {
    margin-top: var(--v3-spacing-3xl);
    padding: var(--v3-spacing-xl);
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
}

.mld-v3-listing-agent h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 var(--v3-spacing-lg) 0;
    color: var(--v3-text-primary);
}

.mld-v3-agent-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--v3-spacing-lg);
}

.mld-v3-agent-item {
    display: flex;
    flex-direction: column;
    gap: var(--v3-spacing-xs);
}

.mld-v3-agent-label {
    font-size: 0.875rem;
    color: var(--v3-text-tertiary);
}

.mld-v3-agent-value {
    font-weight: 600;
    color: var(--v3-text-primary);
}

.mld-v3-agent-contact {
    margin-top: var(--v3-spacing-lg);
    padding: var(--v3-spacing-md);
    background: var(--v3-warning);
    color: var(--v3-text-primary);
    border-radius: var(--v3-radius-md);
    text-align: center;
    font-weight: 500;
}

/* ========================================
   Floating Contact Card
   ======================================== */
.mld-v3-contact-card {
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--v3-nav-height) + var(--v3-spacing-lg));
    background: var(--v3-background);
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius-lg);
    padding: var(--v3-spacing-xl);
    box-shadow: var(--v3-shadow-lg);
    height: fit-content;
    transition: none;
    transform: none;
    right: auto;
    left: auto;
    z-index: 50;
    will-change: position;
}

.mld-v3-contact-header {
    margin-bottom: var(--v3-spacing-lg);
}

.mld-v3-contact-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.mld-v3-agent-info {
    display: flex;
    align-items: center;
    gap: var(--v3-spacing-md);
    margin-bottom: var(--v3-spacing-lg);
}

.mld-v3-agent-name {
    font-weight: 600;
    color: var(--v3-text-primary);
    margin-bottom: var(--v3-spacing-xs);
}

.mld-v3-office-name {
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
}

/* Agent photo in contact card */
.mld-v3-agent-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.mld-v3-agent-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mld-v3-agent-details {
    flex: 1;
}

.mld-v3-contact-actions {
    display: flex;
    flex-direction: column;
    gap: var(--v3-spacing-sm);
}

/* Buttons */
.mld-v3-btn-primary,
.mld-v3-btn-secondary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--v3-spacing-sm);
    padding: var(--v3-spacing-md);
    border-radius: var(--v3-radius-md);
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
    width: 100%;
}

.mld-v3-btn-primary {
    background: var(--v3-primary);
    color: var(--v3-text-inverse);
}

.mld-v3-btn-primary:hover {
    background: var(--v3-primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--v3-shadow-md);
}

.mld-v3-btn-secondary {
    background: var(--v3-background);
    color: var(--v3-text-primary);
    border: 1px solid var(--v3-border);
}

.mld-v3-btn-secondary:hover {
    background: var(--v3-surface);
    border-color: var(--v3-border-hover);
}

.mld-v3-btn-primary svg,
.mld-v3-btn-secondary svg {
    width: 18px;
    height: 18px;
}

.mld-v3-contact-disclaimer {
    margin-top: var(--v3-spacing-md);
    font-size: 0.75rem;
    color: var(--v3-text-tertiary);
    text-align: center;
}

/* ========================================
   Walk Score Styles
   ======================================== */
.mld-v3-walk-scores {
    display: flex;
    gap: var(--v3-spacing-xl);
    padding: var(--v3-spacing-lg);
    background: var(--v3-surface);
    border-radius: var(--v3-radius-lg);
}

.mld-v3-score-item {
    text-align: center;
    flex: 1;
}

.mld-v3-score-value {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: var(--v3-spacing-sm);
}

.mld-v3-score-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--v3-text-primary);
    margin-bottom: var(--v3-spacing-xs);
}

.mld-v3-score-desc {
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
}

.mld-v3-walk-score-footer {
    margin-top: var(--v3-spacing-lg);
    padding-top: var(--v3-spacing-md);
    border-top: 1px solid var(--v3-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--v3-spacing-md);
}

/* ========================================
   Walk Score Modern Theme (from V2)
   ======================================== */
.mld-walk-score-modern {
    background: white;
    border-radius: 12px;
    padding: 24px;
}

.mld-ws-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.mld-ws-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--v3-text-primary);
    margin: 0;
}

.mld-ws-info-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--v3-background);
    color: var(--v3-text-secondary);
    transition: all 0.2s ease;
    text-decoration: none;
}

.mld-ws-info-link:hover {
    background: var(--v3-border);
    color: var(--v3-text-primary);
}

/* Score Cards */
.mld-ws-scores {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.mld-ws-score-card {
    background: var(--v3-background);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.mld-ws-score-card:hover:not(.unavailable) {
    border-color: var(--v3-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

.mld-ws-score-card.unavailable {
    opacity: 0.6;
    cursor: default;
}

.mld-ws-score-icon {
    font-size: 36px;
    margin-bottom: 12px;
    line-height: 1;
}

.mld-ws-score-details {
    margin-bottom: 12px;
}

.mld-ws-score-label {
    font-size: 14px;
    color: var(--v3-text-secondary);
    margin-bottom: 4px;
}

.mld-ws-score-value {
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.mld-ws-score-rating {
    font-size: 13px;
    font-weight: 500;
    color: var(--v3-text-primary);
}

.mld-ws-score-desc {
    font-size: 12px;
    color: var(--v3-text-tertiary);
    margin-top: 4px;
}

.mld-ws-score-unavailable {
    font-size: 14px;
    color: var(--v3-text-tertiary);
    font-style: italic;
}

/* Score Gauge */
.mld-ws-score-gauge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--v3-border);
    overflow: hidden;
}

.mld-ws-score-gauge-fill {
    height: 100%;
    transition: width 0.8s ease;
    position: relative;
}

.mld-ws-score-gauge-fill::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Nearby Places */
.mld-ws-nearby {
    border-top: 1px solid var(--v3-border);
    padding-top: 24px;
    margin-top: 24px;
}

.mld-ws-nearby-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--v3-text-primary);
    margin: 0 0 16px 0;
}

.mld-ws-nearby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
}

.mld-ws-nearby-item {
    background: var(--v3-background);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mld-ws-nearby-category {
    font-size: 14px;
    font-weight: 500;
    color: var(--v3-text-primary);
}

.mld-ws-nearby-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--v3-text-secondary);
}

.mld-ws-nearby-count {
    font-weight: 600;
    color: var(--v3-text-primary);
}

.mld-ws-nearby-distance {
    font-size: 12px;
}

/* Footer */
.mld-ws-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--v3-border);
}

.mld-ws-logo {
    height: 18px;
    opacity: 0.7;
}

.mld-ws-link {
    font-size: 13px;
    color: var(--v3-text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.mld-ws-link:hover {
    color: var(--v3-primary);
    text-decoration: underline;
}

/* ========================================
   Modals
   ======================================== */
.mld-v3-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
    padding: var(--v3-spacing-lg);
}

.mld-v3-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Photo Grid Modal */
.mld-v3-modal-content {
    background: var(--v3-background);
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--v3-radius-lg);
    position: relative;
}

.mld-v3-modal-close {
    position: absolute;
    top: var(--v3-spacing-md);
    right: var(--v3-spacing-md);
    width: 40px;
    height: 40px;
    background: var(--v3-background);
    border: none;
    border-radius: var(--v3-radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--v3-text-primary);
    box-shadow: var(--v3-shadow-md);
    z-index: 10;
    transition: all 0.2s ease;
}

.mld-v3-modal-close:hover {
    background: var(--v3-surface);
    transform: scale(1.05);
}

.mld-v3-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--v3-spacing-md);
    padding: var(--v3-spacing-lg);
}

.mld-v3-grid-photo {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--v3-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mld-v3-grid-photo:hover {
    transform: scale(1.02);
    box-shadow: var(--v3-shadow-lg);
}

/* Form Modals */
.mld-v3-modal-dialog {
    background: var(--v3-background);
    width: 100%;
    max-width: 500px;
    border-radius: var(--v3-radius-lg);
    box-shadow: var(--v3-shadow-xl);
}

.mld-v3-modal-header {
    padding: var(--v3-spacing-xl);
    border-bottom: 1px solid var(--v3-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.mld-v3-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.mld-v3-modal-body {
    padding: var(--v3-spacing-xl);
}

/* Forms */
.mld-v3-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--v3-spacing-md);
    margin-bottom: var(--v3-spacing-md);
}

.mld-v3-form-group {
    margin-bottom: var(--v3-spacing-md);
}

.mld-v3-form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: var(--v3-spacing-sm);
    color: var(--v3-text-primary);
}

.mld-v3-form-group input,
.mld-v3-form-group textarea,
.mld-v3-form-group select {
    width: 100%;
    padding: var(--v3-spacing-sm) var(--v3-spacing-md);
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius-md);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.mld-v3-form-group select {
    font-size: 0.875rem;
    line-height: 1.4;
}

.mld-v3-form-group input:focus,
.mld-v3-form-group textarea:focus,
.mld-v3-form-group select:focus {
    outline: none;
    border-color: var(--v3-primary);
    box-shadow: 0 0 0 3px rgba(0, 106, 255, 0.1);
}

.mld-v3-tour-types {
    display: flex;
    gap: var(--v3-spacing-md);
    margin-bottom: var(--v3-spacing-lg);
}

.mld-v3-tour-type {
    flex: 1;
    display: flex;
    align-items: center;
    gap: var(--v3-spacing-sm);
    padding: var(--v3-spacing-md);
    border: 1px solid var(--v3-border);
    border-radius: var(--v3-radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.mld-v3-tour-type:has(input:checked) {
    background: var(--v3-surface);
    border-color: var(--v3-primary);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    .mld-v3-content {
        grid-template-columns: 1fr;
    }
    
    .mld-v3-contact-card {
        position: static;
        margin-top: var(--v3-spacing-2xl);
    }
    
    .mld-v3-calc-row,
    .mld-v3-form-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    /* Hide this template on mobile - mobile version should be used instead */
    .mld-v3-property {
        display: none;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    /* Hide non-essential elements */
    .mld-v3-nav-bar,
    .mld-v3-gallery-overlay,
    .mld-v3-contact-card,
    .mld-v3-modal,
    .mld-v3-save-btn,
    .mld-v3-share-btn,
    .mld-v3-gallery-actions,
    .mld-v3-nav-actions,
    .mld-v3-tour-btn,
    .mld-v3-message-btn,
    .mld-v3-add-calendar,
    #v3PropertyMap,
    .mld-v3-gallery-map,
    .mld-v3-gallery-streetview,
    .mld-v3-gallery-tour {
        display: none !important;
    }
    
    /* Reset backgrounds and colors */
    body {
        background: white !important;
        color: black !important;
    }
    
    .mld-v3-property {
        max-width: 100% !important;
        margin: 0 !important;
    }
    
    /* Gallery adjustments */
    .mld-v3-hero-gallery {
        height: auto !important;
        max-height: 600px !important;
        page-break-after: always;
    }
    
    .mld-v3-gallery-main {
        position: static !important;
        height: auto !important;
    }
    
    .mld-v3-gallery-image {
        position: static !important;
        opacity: 1 !important;
        display: block !important;
        max-width: 100% !important;
        height: auto !important;
        margin-bottom: 10px;
        page-break-inside: avoid;
    }
    
    /* Show only first 3 images */
    .mld-v3-gallery-image:nth-child(n+4) {
        display: none !important;
    }
    
    /* Content layout */
    .mld-v3-content {
        padding: 0 !important;
    }
    
    .mld-v3-content-grid {
        grid-template-columns: 1fr !important;
        gap: 0 !important;
    }
    
    /* Section styling */
    .mld-v3-section {
        padding: 20px 0 !important;
        page-break-inside: avoid;
        border-bottom: 1px solid #ddd;
    }
    
    .mld-v3-section h2 {
        font-size: 20px !important;
        margin-bottom: 10px !important;
        color: black !important;
    }
    
    /* Property header */
    .mld-v3-property-header {
        page-break-inside: avoid;
        margin-bottom: 20px;
    }
    
    .mld-v3-price {
        font-size: 24px !important;
        color: black !important;
    }
    
    /* Tables */
    .mld-v3-history-table,
    .mld-v3-room-table {
        background: white !important;
        border: 1px solid #ddd !important;
    }
    
    .mld-v3-history-table th,
    .mld-v3-room-table th {
        background: #f5f5f5 !important;
        color: black !important;
        border-bottom: 1px solid #ddd !important;
    }
    
    /* Calculator section - hide interactive elements */
    .mld-v3-calc-inputs {
        display: none !important;
    }
    
    /* Show only the result */
    .mld-v3-calc-results {
        border: 1px solid #ddd !important;
        padding: 10px !important;
        background: white !important;
    }
    
    /* Features grid */
    .mld-v3-features-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    /* Page breaks */
    .mld-v3-hero-gallery,
    #overview,
    #facts,
    #location,
    #schools,
    #payment,
    #history {
        page-break-before: auto;
        page-break-after: auto;
    }
    
    /* Add property URL */
    .mld-v3-property-header::after {
        content: "View online: " attr(data-url);
        display: block;
        font-size: 12px;
        color: #666;
        margin-top: 10px;
    }
    
    /* Ensure text is black */
    * {
        color: black !important;
        background: transparent !important;
    }
    
    /* Links */
    a {
        text-decoration: underline !important;
        color: black !important;
    }
}

/* ========================================
   Sold Property Statistics Section
   ======================================== */
.mld-v3-sold-stats {
    background-color: var(--v3-surface);
    padding: var(--v3-spacing-2xl) 0;
    margin: var(--v3-spacing-2xl) 0;
}

.mld-v3-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--v3-spacing-lg);
    margin-bottom: var(--v3-spacing-2xl);
}

.mld-v3-stat-card {
    background: var(--v3-background);
    border-radius: var(--v3-radius-lg);
    padding: var(--v3-spacing-lg);
    box-shadow: var(--v3-shadow-sm);
    border: 1px solid var(--v3-border);
}

.mld-v3-stat-card.primary {
    border-color: var(--v3-primary);
    border-width: 2px;
}

.mld-v3-stat-card.summary {
    grid-column: 1 / -1;
    background: linear-gradient(to right, #f0f9ff, #ffffff);
}

.mld-v3-stat-header {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--v3-text-primary);
    margin-bottom: var(--v3-spacing-md);
    padding-bottom: var(--v3-spacing-sm);
    border-bottom: 1px solid var(--v3-border);
}

.mld-v3-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--v3-spacing-xs) 0;
    font-size: 0.938rem;
}

.mld-v3-stat-row.highlight {
    background-color: #fef3c7;
    margin: 0 calc(-1 * var(--v3-spacing-sm));
    padding: var(--v3-spacing-sm);
    border-radius: var(--v3-radius-sm);
    font-weight: 600;
}

.mld-v3-stat-row.positive {
    color: var(--v3-success);
}

.mld-v3-stat-row.negative {
    color: var(--v3-danger);
}

.mld-v3-stat-label {
    color: var(--v3-text-secondary);
}

.mld-v3-stat-value {
    font-weight: 600;
    color: var(--v3-text-primary);
}

/* Performance Metrics */
.mld-v3-stat-metric {
    text-align: center;
    padding: var(--v3-spacing-md) 0;
    border-bottom: 1px solid var(--v3-border);
}

.mld-v3-stat-metric:last-child {
    border-bottom: none;
}

.mld-v3-metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--v3-primary);
    line-height: 1.2;
}

.mld-v3-metric-label {
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
    margin-top: var(--v3-spacing-xs);
}

.mld-v3-metric-description {
    font-size: 0.813rem;
    color: var(--v3-text-tertiary);
    margin-top: var(--v3-spacing-xs);
}

.mld-v3-stat-note {
    margin-top: var(--v3-spacing-md);
    padding: var(--v3-spacing-sm);
    background-color: var(--v3-surface);
    border-radius: var(--v3-radius-sm);
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
    text-align: center;
}

.mld-v3-stat-summary {
    font-size: 0.938rem;
    line-height: 1.6;
}

.mld-v3-stat-summary p {
    margin-bottom: var(--v3-spacing-sm);
}

.mld-v3-stat-summary p:last-child {
    margin-bottom: 0;
}

.mld-v3-stat-summary p.positive {
    color: var(--v3-success);
}

.mld-v3-stat-summary p.negative {
    color: var(--v3-danger);
}

.mld-v3-stat-summary strong {
    font-weight: 700;
}

/* Nearby Comparison */
.mld-v3-nearby-comparison {
    background: var(--v3-background);
    border-radius: var(--v3-radius-lg);
    padding: var(--v3-spacing-xl);
    box-shadow: var(--v3-shadow-md);
}

.mld-v3-nearby-comparison h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: var(--v3-spacing-xs);
}

.mld-v3-comparison-subtitle {
    color: var(--v3-text-secondary);
    font-size: 0.875rem;
    margin-bottom: var(--v3-spacing-lg);
}

.mld-v3-comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--v3-spacing-md);
    margin-bottom: var(--v3-spacing-lg);
}

.mld-v3-comparison-item {
    text-align: center;
    padding: var(--v3-spacing-md);
    background-color: var(--v3-surface);
    border-radius: var(--v3-radius-md);
}

.mld-v3-comparison-item.positive {
    background-color: #dcfce7;
}

.mld-v3-comparison-item.negative {
    background-color: #fee2e2;
}

.mld-v3-comparison-label {
    font-size: 0.875rem;
    color: var(--v3-text-secondary);
    margin-bottom: var(--v3-spacing-xs);
}

.mld-v3-comparison-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--v3-text-primary);
}

.mld-v3-comparison-summary {
    padding: var(--v3-spacing-md);
    background-color: var(--v3-surface);
    border-radius: var(--v3-radius-md);
    font-size: 0.938rem;
    color: var(--v3-text-secondary);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .mld-v3-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .mld-v3-comparison-grid {
        grid-template-columns: 1fr;
    }
    
    .mld-v3-metric-value {
        font-size: 1.5rem;
    }
}