/* ==========================================================================
   0. Header/Footer Styles
   ========================================================================== */
.site-header {
    background-color: var(--neutral-white);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    position: relative;
    z-index: 100;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-header nav a {
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.site-header nav a:hover {
    background-color: var(--secondary-bg);
}

.site-header.nav-open .main-nav-wrapper {
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.site-header.nav-open nav {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.main-nav-wrapper {
    display: none; /* Hide the nav wrapper by default on all screen sizes */
    position: absolute;
    top: 100%; /* Position right below the header */
    left: 0;
    right: 0;
    background-color: var(--neutral-white);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px;
}

.mobile-nav-toggle {
    display: block; /* Show hamburger by default */
    font-size: 2rem;
    background: none;
    border: none;
    color: var(--primary-text);
    cursor: pointer;
}

.branding {
    text-decoration: none;
    color: var(--primary-text);
    display: flex;
    align-items: center;
}

.site-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-text);
}

.footer-container {
    display: flex;
    flex-direction: column;
    text-align: center;
    gap: 30px;
}

.footer-links {
    display: flex;
    gap: 25px; /* Space between the links */
}

.footer-links a {
    color: var(--primary-text);
    text-decoration: none;
    font-weight: 700;
}

.footer-links a:hover {
    text-decoration: underline;
    color: var(--link-color);
}

.copyright-text {
    font-size: 0.85rem;
    color: #888;
    margin: 0;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 a {
    text-decoration: none;
    color: inherit;
}

nav {
    margin-top: 10px;
}

nav a {
    margin-right: 20px;
    text-decoration: none;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--link-color); /* Use Coastal Blue for nav links */
    transition: color 0.2s ease-in-out;
}

nav a:hover {
    color: var(--accent-color); /* Use Sunset Orange for hover */
    text-decoration: none;
}

.site-logo {
    height: 35px; /* Control the logo height here */
    width: auto;
}

footer {
    margin-top: auto;
    padding: 40px 0;
    background-color: var(--secondary-bg);
    border-top: 1px solid var(--border-color);
    color: #6c757d;
    font-size: 0.9rem;
}

.footer-content {
    display: flex;
    flex-direction: column; /* Stack the items vertically */
    align-items: flex-end;
    gap: 10px; /* Add a little space between the copyright and the links */
    text-align: right;
}

.footer-content p {
    margin: 0 0 15px 0;
}

/* ==========================================================================
   1. Hero Styles
   ========================================================================== */
.hero-section {
    position: relative;
    height: 450px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    background-image: url('https://images.unsplash.com/photo-1570129477492-45c003edd2be?q=80&w=2070');
    background-size: cover;
    background-position: center;
    overflow: hidden;
    margin-top: 10px;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Dark overlay for text readability */
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--neutral-white);
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    color: var(--neutral-white);
}

.hero-search-form {
    display: flex;
    gap: 10px;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 10px;
    border-radius: 8px;
    max-width: 800px;
    margin: 30px auto 0;
}

.hero-search-form input {
    border: 1px solid #ccc;
    padding: 12px;
    border-radius: 4px;
}

.hero-search-form input[type="text"] {
    flex-grow: 1;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1; /* Allows it to take up available space */
}

.search-input-wrapper svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

.search-input-wrapper input {
    padding-left: 45px; /* Make room for the icon */
    width: 100%;
}

.hero-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.hero-nav a {
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--link-color); /* Use Coastal Blue for hero nav links */
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background-color 0.2s ease-in-out, color 0.2s ease-in-out;
}

.hero-nav a:hover {
    background-color: var(--accent-color); /* Use Sunset Orange for hover */
    color: var(--neutral-white);
}

/* ==========================================================================
   2. Home Styles
   ========================================================================== */
.agent-intro, .office-map {
    width: 100%; /* Ensure they fill the split layout column */
}

.cta-blocks {
    display: block;
}

.cta-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%; /* Equal height */
}

.agent-headshot {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid var(--neutral-white);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ==========================================================================
   3. Listing Styles
   ========================================================================== */
.property-card .card-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.property-card.highlighted {
    border-color: var(--accent-color);
    box-shadow: 0 6px 15px rgba(0,0,0,0.2);
    transform: scale(1.03);
    background-color: #FFF4E3; /* A light, noticeable shade of the theme's orange */
}

.property-info {
    flex-grow: 1;
}

.property-image-container {
    position: relative;
}

.property-price {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    color: var(--primary-text);
    margin: 0 0 5px 0;
}

.property-stats {
    font-size: 0.9rem;
    margin: 0 0 8px 0;
}

.property-address {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

.property-address a:hover {
    text-decoration: underline;
}

.property-agent {
    font-size: 0.8rem;
    color: #777;
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
    text-align: right;
}

.property-type-badge {
    display: inline-block;
    margin: 5px 0 10px 0;
    padding: 4px 8px;
    background-color: var(--accent-color);
    color: var(--neutral-white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
}

/* --- Property Status Ribbon --- */
.property-status-ribbon {
    position: absolute;
    top: 15px;
    left: -8px;
    padding: 5px 15px;
    background-color: var(--accent-color);
    color: var(--neutral-white);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

/* Specific status colors */
.property-status-ribbon.status-pending {
    background-color: #ffc107; /* Orange */
}
.property-status-ribbon.status-sold {
    background-color: #e34c26; /* Red */
}
.property-status-ribbon.status-short-sale-pending {
    background-color: #6a0572; /* Dark Purple */
}

.property-status-ribbon.status-bumpable {
    background-color: #007bff; /* A professional blue */
}

.property-status-ribbon.status-short-sale-pending,
.property-status-ribbon.status-pending-lease-option {
    background-color: #6f42c1; /* Deep purple */
}

/* RMLS Logo */
.rmls-logo {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 50px;
    height: auto;
    background: rgba(255,255,255,0.8);
    padding: 2px;
    border-radius: 3px;
}

.rmls-logo-detail {
    width: 70px;
    height: auto;
    flex-shrink: 0;
}

/* --- Disclaimer Box --- */
.disclaimer-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
    margin-top: 40px;
    padding-top: 20px;
    padding-bottom: 20px;
    font-size: 0.8rem;
    color: #6c757d;
    border-top: 1px solid var(--border-color);
}

.disclaimer-logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.results-container {
    width: 100%;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.property-card-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: 1fr; /* 1 column on mobile */
}

.card-image-placeholder {
    height: 180px;
    background-color: #ccc; /* A simple grey placeholder */
}

.card-content {
    padding: 20px;
    flex-grow: 1; /* Allows content to fill space */
}

.card-content a {
    text-decoration: none;
    color: var(--link-color);
    font-size: 1.2rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
}

.card-image {
    height: 180px;
    width: 100%;
    object-fit: cover;
    display: block;
}

.card-link-wrapper {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-title {
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-text);
    margin: 0 0 5px 0;
}

.card-subtitle {
    font-size: 0.9rem;
    color: #555;
    margin: 0;
}

.card-main-content {
    display: flex;
    justify-content: space-between;
    flex-grow: 1;
}

.card-actions {
    display: flex;
    flex-direction: column; /* Stacks share and like buttons */
    align-items: flex-end;
    gap: 8px;
}

.action-btn {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 50%; /* Makes the buttons circular */
    width: 36px;
    height: 36px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.agent-info {
    display: flex;
    flex-direction: column; /* Stack the text vertically */
}

.brokerage-logo-header {
    height: 45px; /* Adjust size as needed */
    width: auto;
}

.d-none {
    display: none !important;
}

.featured-section .property-card-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile: Full width (1 column) */
    gap: 30px;
    margin-bottom: 40px;
}

.featured-section .property-card .card-image {
    height: 280px; /* Taller images for featured cards */
    object-fit: cover;
}

/* ==========================================================================
   4. Detail Page Styles
   ========================================================================== */
.detail-layout {
    display: flex;
    flex-direction: column; /* Mobile first: stack the columns */
    gap: 30px;
}

.detail-header {
    display: flex;
    flex-direction: column; /* Stack on mobile by default */
    gap: 15px;
    margin-bottom: 20px;
}

.detail-header h2 {
    margin: 0;
}

.detail-main-content {
    flex: 1;
}

.detail-sidebar {
    width: 100%;
}

.detail-article {
    position: relative;
    z-index: 1;
    background-color: var(--neutral-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    overflow-wrap: break-word;
}

.detail-article hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

.detail-meta {
    font-style: italic;
    color: #555;
    margin-bottom: 20px;
}

/* --- Image Gallery Styles --- */
.image-gallery .main-image {
    width: 100%;
    height: auto;
    max-height: 60vh;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative; /* CRUCIAL: This is the anchor for the arrows */
}

.image-gallery .main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-gallery:hover .gallery-arrow {
    opacity: 1;
}

.gallery-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    border: 1px solid #ccc;

    /* Make the button a circle */
    width: 80px;
    height: 80px;
    border-radius: 50%;

    font-size: 20px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.gallery-arrow:hover {
    background-color: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.gallery-arrow.prev {
    left: 15px;
}

.gallery-arrow.next {
    right: 15px;
}

.thumbnail {
    width: 100px;
    height: 75px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s;
}

.thumbnail:hover, .thumbnail.active {
    border-color: var(--link-color);
}

.thumbnail-container {
    position: relative;
    display: flex;
    align-items: center;
}

.thumbnail-strip {
    display: flex;
    flex-wrap: wrap; /* Allow thumbnails to wrap to the next line */
    gap: 10px;
}

/* --- Agent Info Box --- */
.agent-info-box {
    background-color: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    margin: 30px 0;
}

.agent-info-box h4 {
    margin: 0 0 5px 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.2rem;
    color: var(--primary-text);
}

.agent-info-box p {
    margin: 0 0 20px 0;
    font-size: 0.9rem;
    color: #555;
}

.agent-info-box .button {
    display: block;
    width: 100%;
    margin-bottom: 10px;
}

.agent-info-box .button.secondary {
    background-color: transparent;
    color: var(--link-color);
    border: 1px solid var(--border-color);
}
.agent-info-box .button.secondary:hover {
    background-color: var(--border-color);
    color: var(--primary-text);
}

.sidebar-cta {
    margin-top: 20px;
    padding: 20px;
    text-align: center;
    border: 1px dashed var(--border-color);
    border-radius: 8px;
}

.property-description {
    line-height: 1.6;
    color: #444;
}

.detail-main-info {
    margin: 15px 0;
}

.simple-list {
    list-style: none;
    padding: 0;
}

.simple-list li {
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.simple-list li:last-child {
    border-bottom: none;
}

.disclaimer-text {
    font-size: 0.8rem;
    font-style: italic;
    color: #6c757d;
}

.disclaimer-text-content p {
    margin: 0 0 10px 0;
}

.disclaimer-text-content p:last-child {
    margin-bottom: 0;
}

/* ==========================================================================
   5. Map Styles
   ========================================================================== */
/* --- Map Page Layout --- */
.map-layout {
    /* On mobile, stack the map on top of the results */
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.map-container {
    /* On mobile, map is a 400px tall block */
    height: 400px;
    width: 100%
}

.map-placeholder {
    width: 100%;
    height: 100%;
    background-color: #e0e0e0;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* --- Custom Map Marker Styles --- */
.custom-marker {
    background-color: #333;
    color: white;
    height: 28px;
    padding: 0 12px;
    border-radius: 14px;
    border: 2px solid white;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease-in-out;
}

/* Status colors */
.custom-marker.status-active {
    background-color: #28a745; /* Green */
}
.custom-marker.status-pending {
    background-color: #ffc107; /* Yellow */
    color: #333; /* Darker text for yellow background */
}
.custom-marker.status-bumpable {
    background-color: #007bff; /* A professional blue */
}

.custom-marker.status-short-sale-pending,
.custom-marker.status-pending-lease-option {
    background-color: #6f42c1; /* Deep purple */
}

.custom-marker.highlighted {
    height: 34px; /* Increase height */
    padding: 0 16px; /* Increase padding for a wider look */
    border-radius: 17px; /* Adjust radius */
    font-size: 14px; /* Make the font a bit bigger */
    z-index: 10;
    background-color: var(--accent-color);
    color: var(--neutral-white);
}

/* --- Mapbox Popup Styles --- */
.mapboxgl-popup-content {
    background-color: var(--neutral-white);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 0; /* Remove default padding */
    font-family: 'Lato', sans-serif;
}

.mapboxgl-popup-close-button {
    /* Make the 'x' button easier to see and click */
    color: var(--primary-text);
    font-size: 20px;
    padding: 5px;
}

.popup-container {
    border-radius: 8px; /* Match our other components */
    overflow: hidden; /* This is what rounds the image corners */
}

.popup-image-container {
    position: relative;
}

.popup-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
    display: block;
}

.popup-content {
    padding: 10px;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-price {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.popup-address {
    font-size: 0.9rem;
    margin: 5px 0 0 0;
}

.popup-stats {
    font-size: 0.9rem;
    margin: 8px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
}

.popup-agent {
    font-size: 0.75rem;
    color: #777;
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.popup-link {
    text-decoration: none;
    color: var(--primary-text);
}

.popup-ribbon {
    top: 10px;      /* Adjust position for the smaller popup */
    left: -5px;
    padding: 3px 8px;
    font-size: 0.7rem;
    min-width: 80px;
}

.rmls-logo-popup {
    height: 25px; /* Adjust size as needed */
    width: auto;
}

#map {
    width: 100%;
    height: 100%;
    border-radius: 8px; /* Match our other components */
}

/* ==========================================================================
   6. Filter Styles
   ========================================================================== */
/* --- Filter Bar Styles --- */
.filter-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    align-items: flex-end;
    padding: 20px;
    background-color: var(--secondary-bg); /* Use the theme's main background */
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--primary-text);
}

.filter-group select,
.filter-group input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: 'Lato', sans-serif;
    font-size: 1rem;
    width: 100%;
    background-color: var(--neutral-white); /* Make inputs stand out */
    transition: border-color 0.2s, box-shadow 0.2s;
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-color) 20%, transparent);
}

.filter-tags {
    margin: 20px 0;
}

.filter-tag {
    display: inline-block;
    background-color: var(--neutral-white);
    border: 1px solid var(--border-color);
    color: var(--link-color);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    margin-right: 10px;
    margin-bottom: 10px;
    transition: all 0.2s ease-in-out;
}

.filter-tag:hover {
    background-color: var(--link-color);
    color: var(--neutral-white);
    border-color: var(--link-color);
}

.filter-tag.active,
.filter-tag.active:hover {
    background-color: var(--link-color);
    color: var(--neutral-white);
    border-color: var(--link-color);
}

.filter-apply-btn {
    width: 100%;
}

.filter-reset-btn {
    color: var(--link-color);
    text-decoration: none;
    font-size: 0.9rem;
    white-space: nowrap;
}

.filter-reset-btn:hover {
    text-decoration: underline;
}

.input-range {
    display: flex;
    align-items: center;
    gap: 5px;
}

.input-range input {
    width: 100%;
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    padding-bottom: 2px;
    /*justify-content: flex-end;*/
}

/* ==========================================================================
   7. Pagination Styles
   ========================================================================== */
.pagination {
    margin-top: 40px;
    text-align: center;
}

.pagination .step-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 5px; /* 8px vertical gap, 5px horizontal gap */
}

.pagination .step-links a, .pagination .step-links .current {
    margin: 0 4px;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease-in-out;
    vertical-align: middle;
}

.pagination .step-links .ellipsis {
    padding: 8px 5px;
    vertical-align: middle;
}

.pagination .step-links a:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: var(--neutral-white);
}

.pagination .step-links .current {
    background-color: var(--link-color);
    border-color: var(--link-color);
    color: var(--neutral-white);
    font-weight: 700;
}

/* ==========================================================================
   8. Contact Styles
   ========================================================================== */
.sell-page-image {
    width: 100%;
    border-radius: 8px;
    margin: 15px 0;
}

.feature-list {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.feature-item svg {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--accent-color);
    margin-top: 2px;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-shrink: 0;
}

.social-icons {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
}

.social-icons a {
    transition: opacity 0.2s;
}
.social-icons a:hover {
    opacity: 0.7;
}

.social-icons .social-icon-web { color: var(--primary-text); }
.social-icons .social-icon-fb { color: #1877F2; } /* Facebook Blue */
.social-icons .social-icon-ig { color: #E4405F; } /* Instagram Pink */
.social-icons .social-icon-tt { color: #000000; } /* TikTok Black */
.social-icons .social-icon-yt { color: #FF0000; } /* YouTube Red */


/* ==========================================================================
   9. Chat/Comments & Favorites Layout
   ========================================================================== */
.favorite-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0; /* No gap, we use borders/padding */
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--neutral-white);
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.fav-card-container {
    flex: 1;
    min-width: 300px;
    max-width: 350px;
    padding: 20px;
    background: var(--neutral-white);
    border-right: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

/* Fix for the partial to fit nicely */
.fav-card-wrapper {
    width: 100%;
    max-width: 320px;
}

.fav-chat-container {
    flex: 2;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    padding: 20px;
    background-color: #fdfdfd;
}

/* --- ZIG-ZAG LAYOUT LOGIC --- */
/* Every even row reverses direction (Card Right, Chat Left) */
.favorite-row:nth-child(even) {
    flex-direction: row-reverse;
}

.favorite-row:nth-child(even) .fav-card-container {
    border-right: none;
    border-left: 1px solid var(--border-color);
}

.favorite-row:nth-child(even) .fav-chat-container {
    background-color: #fafafa; /* Slight tint distinction */
}

/* --- CHAT BUBBLES --- */
.chat-window {
    flex-grow: 1;
    max-height: 350px;
    overflow-y: auto;
    padding: 15px;
    background: var(--neutral-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 15px;
}

.chat-msg {
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: 18px;
    max-width: 80%;
    font-size: 0.95rem;
    position: relative;
    clear: both;
    line-height: 1.4;
}

.chat-msg .meta {
    display: block;
    font-size: 0.7rem;
    margin-bottom: 4px;
    opacity: 0.8;
}

/* ME (User) */
.chat-msg.me {
    background-color: var(--link-color); /* Matches site theme */
    color: white;
    float: right;
    border-bottom-right-radius: 4px;
}
.chat-msg.me .meta { text-align: right; color: #daeeff; }

/* THEM (Agent) */
.chat-msg.them {
    background-color: #f3f4f6;
    color: var(--primary-text);
    float: left;
    border-bottom-left-radius: 4px;
}
.chat-msg.them .meta { color: #6b7280; }

.chat-window::after { content: ""; display: table; clear: both; }

.chat-input-group {
    display: flex;
    gap: 10px;
    width: 100%;
}

.chat-input-group input {
    flex-grow: 1;
    width: auto;
}

.chat-input-group button {
    flex-shrink: 0;
    width: auto;
    min-width: 80px;
}

/* --- AGENT TABLE STYLES (New) --- */
/* The Favorites Box Container */
.favorites-section {
    margin-top: 30px;
}

/* The Header "Liked Properties (3)" */
.favorites-header {
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
    color: var(--primary-text);
}

.favorites-table-wrapper {
    overflow-x: auto;
    width: 100%;
}

.favorites-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
}

.favorites-table th {
    text-align: left;
    color: #666;
    font-size: 0.9rem;
    padding: 12px;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.favorites-table td {
    padding: 12px;
    border-bottom: 1px solid #f9f9f9;
    vertical-align: middle;
}

.fav-prop-summary {
    display: flex;
    align-items: center;
    gap: 15px;
}

.fav-img-small {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #eee;
    flex-shrink: 0;
}

.fav-prop-link {
    font-weight: 600;
    text-decoration: none;
    color: var(--primary-text);
    display: block;
    line-height: 1.2;
}

.fav-prop-link:hover {
    color: var(--link-color);
    text-decoration: underline;
}

.fav-prop-city {
    font-size: 0.85rem;
    color: #7f8c8d;
    margin-top: 2px;
}

.fav-img-placeholder {
    width: 50px;
    height: 50px;
    background-color: #eee;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: #999;
    flex-shrink: 0;
}

.fav-date {
    color: #7f8c8d;
    font-size: 0.9rem;
}

.fav-price {
    font-weight: 500;
    color: var(--primary-text);
}

.fav-site-id {
    font-size: 0.85rem;
    color: #555;
}

.fav-empty-state {
    color: #7f8c8d;
    padding: 10px 0;
    font-style: italic;
}

.site-pill {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: lowercase;
    white-space: nowrap;
}

/* Default Color (Light Blue) */
.site-pill.default {
    background-color: #e0f2fe;
    color: #0284c7;
    border: 1px solid #bae6fd;
}

/* Optional: Different color for System/Localhost domains */
.site-pill.system {
    background-color: #f3f4f6;
    color: #4b5563;
    border: 1px solid #e5e7eb;
}

/* ==========================================================================
   10. Agent Inbox / Message Center
   ========================================================================== */
.inbox-container {
    display: flex;
    height: calc(100vh - 70px); /* Full height minus header */
    background-color: var(--neutral-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /* Contains the scrollbars */
    margin-bottom: 30px;
}

/* --- Left Sidebar (Lead List) --- */
.inbox-sidebar {
    width: 320px;
    border-right: 1px solid var(--border-color);
    background-color: #fcfcfc;
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.inbox-sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--neutral-white);
}

.inbox-sidebar-header h3 {
    margin: 0;
    font-size: 1.1rem;
    color: var(--primary-text);
}

.inbox-lead-list {
    flex-grow: 1;
    overflow-y: auto; /* Independent scroll */
}

.inbox-item {
    display: block;
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: var(--primary-text);
    transition: background-color 0.15s;
    position: relative;
}

.inbox-item:hover {
    background-color: #f1f5f9;
}

.inbox-item.active {
    background-color: #e0f2fe; /* Light Blue highlight */
    border-left: 4px solid var(--link-color);
}

.inbox-item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.inbox-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.inbox-date {
    font-size: 0.75rem;
    color: #888;
}

.inbox-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: #666;
}

/* Unread Badge */
.unread-badge {
    background-color: #ef4444; /* Red */
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 10px;
    display: inline-block;
}

/* --- Right Content (Conversation) --- */
.inbox-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: var(--secondary-bg);
}

.inbox-main-header {
    padding: 15px 25px;
    background-color: var(--neutral-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.inbox-content-scroll {
    flex-grow: 1;
    overflow-y: auto; /* Independent scroll for the zig-zag list */
    padding: 30px;
}

/* Empty State */
.inbox-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
}

/* ==========================================================================
   11. Agent Dashboard & Headers
   ========================================================================== */

/* --- Agent Top Navigation (Replaces inline styles in agent_base.html) --- */
.agent-header {
    background-color: #2c3e50; /* Dark Slate */
    color: var(--neutral-white);
    padding: 0;
    margin-bottom: 30px;
}

.agent-header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.agent-header-left {
    display: flex;
    align-items: center;
}

.agent-brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--neutral-white);
    text-decoration: none;
    margin-right: 30px;
}

.agent-nav {
    display: flex;
    gap: 5px;
    height: 100%;
    align-items: center;
}

.agent-nav-link {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.2s;
    font-weight: 500;
}

.agent-nav-link:hover,
.agent-nav-link.active {
    color: var(--neutral-white);
    background-color: rgba(255,255,255,0.1);
}

.agent-logout-link {
    color: #bdc3c7;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 6px 12px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    margin-left: 15px;
    transition: all 0.2s;
}

.agent-logout-link:hover {
    background-color: #e74c3c;
    border-color: #e74c3c;
    color: var(--neutral-white);
}

.agent-footer {
    padding: 30px 0;
    text-align: center;
    color: #999;
    font-size: 0.8rem;
    margin-top: 50px;
    border-top: 1px solid var(--border-color);
}

/* Container for the Header + Button */
.favorites-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Ensure the existing header class has no bottom border/margin
   when used inside the toolbar, so the toolbar handles it. */
.favorites-toolbar .favorites-header {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.logout-link {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 500;
}

/* ==========================================================================
   12. Modals & Overlays
   ========================================================================== */
.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.is-visible {
    display: flex;
}

.modal-card {
    background-color: var(--neutral-white);
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-bottom: 5px;
}

.modal-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 10px;
}

/* Agent Sidebar Widget */
.agent-tools-box {
    background-color: #f0f9ff; /* Light Blue */
    border: 1px solid #bae6fd;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
}

.agent-tools-title {
    color: #0369a1;
    margin-top: 0;
    font-size: 1.1rem;
    margin-bottom: 15px;
    font-weight: 700;
}

/* ==========================================================================
   13. Listing Manager (My Listings)
   ========================================================================== */
.manager-container {
    padding: 20px 0;
}

.manager-subtitle {
    color: #666;
    margin: 0;
}

.manager-section {
    margin-bottom: 50px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 30px;
}

.manager-section:last-child {
    border-bottom: none;
}

.manager-section-title {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.manager-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.manager-count-badge {
    background-color: #e0f2fe;
    color: #0369a1;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
}

/* --- Manual Add Form --- */
.manual-add-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.manual-add-input {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    width: 200px;
}

/* --- Recommendation Cards (The "Inbox") --- */
.rec-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.rec-card {
    background: var(--neutral-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rec-image {
    height: 180px;
    width: 100%;
    object-fit: cover;
    background-color: #eee;
}

.rec-content {
    padding: 15px;
    flex-grow: 1;
}

.rec-reason-badge {
    background-color: #e0f2fe; /* Light Blue */
    color: #0369a1;
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
    font-weight: 600;
}

.rec-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-top: 1px solid var(--border-color);
}

.rec-btn {
    border: none;
    padding: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.2s;
    font-size: 0.9rem;
}

.rec-btn.accept {
    background-color: #f0fdf4; /* Light Green */
    color: #15803d;
    border-right: 1px solid var(--border-color);
}
.rec-btn.accept:hover { background-color: #dcfce7; }

.rec-btn.reject {
    background-color: #fef2f2; /* Light Red */
    color: #b91c1c;
}
.rec-btn.reject:hover { background-color: #fee2e2; }

.rec-no-image-placeholder {
    height: 180px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    background-color: #eee;
}

/* --- Recommendation Card Typography --- */
.rec-price-text {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 5px;
    color: var(--primary-text);
}

.rec-address-text {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.4;
}

.rec-mls-text {
    margin-top: 10px;
    font-size: 0.8rem;
    color: #888;
}

/* --- Empty State --- */
.manager-empty-state {
    text-align: center;
    padding: 40px;
    background-color: #f9f9f9;
    border-radius: 8px;
    color: #777;
    border: 1px dashed var(--border-color);
}

/* --- Managed Listing Wrapper (For Active List) --- */
.managed-listing-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* The Remove Button sits below the card */
.remove-listing-btn {
    width: 100%;
    margin-top: 10px;
    background-color: white;
    border: 1px solid #fee2e2;
    color: #b91c1c;
    padding: 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.remove-listing-btn:hover {
    background-color: #b91c1c;
    color: white;
    border-color: #b91c1c;
}

/* Override partial styles if needed within this wrapper */
.managed-listing-wrapper .property-card {
    height: 100%; /* Ensure card fills height so buttons align */
}

/* ==========================================================================
   14. Homepage Specific Styles (No Inline)
   ========================================================================== */

/* CTA Section */
.cta-section {
    padding: 40px 0;
}

.cta-grid {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.card-action-bottom {
    margin-top: auto;
    padding-top: 15px;
}

/* Featured Listings Section */
.featured-section {
    padding: 60px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.featured-header {
    text-align: center;
    margin-bottom: 40px;
}

.featured-header h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: var(--primary-text);
}

.featured-header p {
    color: #666;
    font-size: 1.1rem;
}

.featured-footer {
    text-align: center;
    margin-top: 40px;
}

/* Agent & Office Section */
.agent-section {
    padding-bottom: 40px;
    align-items: flex-start;
}

/* Agent Headshot & Bio */
.agent-headshot {
    float: left;
    margin-right: 20px;
    margin-bottom: 15px;
    width: 120px;
    height: 120px;
    border-radius: 50%; /* Optional: Makes it circular, remove if you want square */
    object-fit: cover;
    border: 3px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.agent-bio-link {
    clear: both;
    margin-top: 15px;
    display: inline-block;
}

/* Contact Details Box */
.contact-details-box {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.agent-socials {
    justify-content: flex-start;
    border-top: none;
    padding-top: 5px;
    margin-top: 10px;
}

/* Office Map Area */
.office-map-image {
    width: 100%;
    height: 300px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--border-color);
}

.map-contact-btn {
    margin-top: 15px;
}

/* ==========================================================================
   15. Soft Gate (Lead Capture Modal)
   ========================================================================== */
.soft-gate-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10000;
    display: none; /* Hidden by default */
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
}

.soft-gate-overlay.active {
    display: flex;
}

.soft-gate-card {
    background: white;
    padding: 40px;
    width: 100%;
    max-width: 500px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3);
    position: relative;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.soft-gate-title {
    font-size: 1.6rem;
    margin-bottom: 15px;
    color: var(--primary-text);
    font-weight: 700;
}

.soft-gate-text {
    color: #555;
    margin-bottom: 25px;
    font-size: 1rem;
    line-height: 1.5;
}

.soft-gate-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.soft-gate-input {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.soft-gate-submit {
    padding: 12px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.soft-gate-submit:hover {
    opacity: 0.9;
}

.soft-gate-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #999;
    cursor: pointer;
}

.soft-gate-login-link {
    margin-top: 20px;
    display: block;
    font-size: 0.9rem;
    color: var(--link-color);
    text-decoration: underline;
}

/* Upsell Step (Hidden initially) */
.soft-gate-upsell {
    display: none;
}

/* ==========================================================================
   16. Dashboard Mission Control (Grid Layout)
   ========================================================================== */
.dashboard-page-header {
    margin-bottom: 25px;
}
.dashboard-page-header h1 {
    font-size: 1.8rem;
    margin-bottom: 5px;
    color: var(--primary-text);
}
.dashboard-page-header p {
    color: #666;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stacked single column */
    gap: 20px;
}

/* Stats Row */
.stat-card {
    margin-bottom: 0;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-color);
}

.stat-label {
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 5px;
}

/* Layout Columns */
.main-column, .side-column {
    grid-column: span 1;
}

/* Panels */
.dashboard-panel {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
}

.dashboard-panel h3 {
    margin-top: 0;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--primary-text);
}

/* Action Buttons */
.action-buttons-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Activity Feed */
.activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.activity-item:last-child { border-bottom: none; }

.activity-icon {
    margin-right: 12px;
    font-size: 1.2rem;
    background: #f3f4f6;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.activity-details {
    font-size: 0.95rem;
}

.activity-time {
    display: block;
    font-size: 0.8rem;
    color: #999;
}

/* Promo Cards */
.promo-card {
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.isa-promo {
    background-color: #f0fdf4; /* Green tint */
    border-color: #bbf7d0;
}

.ads-promo {
    background-color: #eff6ff; /* Blue tint */
    border-color: #bfdbfe;
}

.promo-card h3 {
    margin-top: 0;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.promo-card p {
    font-size: 0.9rem;
    color: #555;
    margin-bottom: 15px;
}

/* Lead Snapshot */
.snapshot-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}
.snapshot-row:last-child { border-bottom: none; }

.badge {
    background: #e5e7eb;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
}

/* ==========================================================================
   17. Client Portal Styles (cp-)
   ========================================================================== */

.cp-container {
    padding-top: 40px;
    padding-bottom: 60px;
}

/* Header Area */
.cp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.cp-subtitle {
    color: #666;
    margin-top: 5px;
}

/* Main Grid Layout */
.cp-grid {
    display: grid;
    grid-template-columns: 1fr 2fr; /* Sidebar is 1/3, Favorites are 2/3 */
    gap: 30px;
}

.cp-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Sidebar Cards */
.cp-card {
    padding: 20px;
}

.cp-card-title {
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: var(--primary-text);
}

/* Saved Search List */
.cp-search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cp-search-item {
    margin-bottom: 15px;
    border-bottom: 1px solid #f5f5f5;
    padding-bottom: 10px;
}

.cp-search-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cp-search-date {
    font-size: 0.85rem;
    color: #999;
    margin-bottom: 4px;
}

.cp-search-link {
    font-weight: 600;
    color: var(--accent-color);
    text-decoration: none;
    display: inline-block;
}

.cp-search-link:hover {
    text-decoration: underline;
}

.cp-search-details {
    font-size: 0.85rem;
    color: #666;
    margin-top: 2px;
    word-break: break-all; /* Prevents long URL params from breaking layout */
}

.cp-empty-text p {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.cp-empty-text a {
    font-size: 0.9rem;
    color: var(--link-color);
}

/* Recent Messages List */
.cp-message-list {
    list-style: none;
    padding: 0;
}

.cp-message-item {
    margin-bottom: 10px;
    font-size: 0.9rem;
    color: var(--primary-text);
}

/* Main Content Area */
.cp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.cp-section-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary-text);
}

/* Empty Favorites State */
.cp-favorites-empty {
    text-align: center;
    padding: 40px;
}

.cp-favorites-empty p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

/* ==========================================================================
   18. Service & Add-on Pages (svc-)
   ========================================================================== */

/* --- Base Styles (Mobile First) --- */

.svc-container {
    max-width: 1000px;
    margin: 0 auto;
    padding:20px;
    padding-bottom: 60px;
}

/* Hero Section */
.svc-hero {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 40px;
    border: 1px solid var(--border-color);
}

.svc-hero h1 {
    font-size: 1.8rem; /* Mobile size */
    margin-bottom: 10px;
    color: var(--primary-text);
}

.svc-hero p {
    font-size: 1rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* The Green/Blue Hero Box for Active Services */
.svc-hero-active {
    text-align: center;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e5e7eb; /* Default gray */
}

.svc-hero-active.isa-active {
    border-color: #22c55e; /* Green border */
}

.svc-hero-active.ads-active {
    border-color: #3b82f6; /* Blue border */
}

.svc-status-icon {
    font-size: 3rem;
    margin-bottom: 10px;
    line-height: 1;
}

.svc-active-title {
    margin: 0 0 10px 0;
    font-size: 1.8rem;
    font-weight: 700;
}

.svc-hero-active.isa-active .svc-active-title { color: #15803d; } /* Dark Green */
.svc-hero-active.ads-active .svc-active-title { color: #1d4ed8; } /* Dark Blue */

/* The "Details Box" inside the Active Hero */
.svc-status-details {
    padding: 20px;
    border-radius: 8px;
    margin: 30px auto;
    max-width: 500px;
    text-align: left;
}

.svc-status-details.isa-details { background: #f9fafb; }
.svc-status-details.ads-details { background: #eff6ff; }

.svc-detail-row {
    margin-bottom: 10px;
    font-size: 0.95rem;
    color: var(--primary-text);
}

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

/* Status Text Colors */
.text-pending { color: #f59e0b; font-weight: 500; } /* Orange */
.text-active { color: #16a34a; font-weight: 700; } /* Green */

/* --- NEW: Gate / Approval Messages --- */

.svc-gate-message {
    background: #ecfdf5;
    border: 1px solid #10b981;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    text-align: center;
}

.svc-gate-text {
    color: #047857;
    margin-bottom: 15px;
    font-size: 1.05rem;
}

/* --- Dashboard Sidebar States --- */

/* Active ISA Panel */
.promo-card.isa-active {
    border-color: #22c55e;
    background: #f0fdf4;
}

.promo-card.isa-active h3 {
    color: #15803d;
}

/* Active Ads Panel */
.promo-card.ads-active {
    border-color: #3b82f6;
    background: #eff6ff;
}

.promo-card.ads-active h3 {
    color: #1d4ed8;
}

.svc-hero-subtext {
    font-size: 0.85rem;
    margin-top: 10px;
    color: #999 !important;
}

/* Feature Grid (Icon Cards) */
.svc-features-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 20px;
    margin-bottom: 40px;
}

.svc-feature-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    text-align: center;
}

.svc-feature-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.svc-feature-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    color: var(--primary-text);
}

.svc-feature-card p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

/* Pricing Cards */
.svc-pricing-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 20px;
    margin-bottom: 40px;
    align-items: start;
}

.svc-pricing-card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 25px;
    position: relative;
    text-align: center;
}

/* Featured/Popular Card Styling */
.svc-pricing-card.svc-featured {
    border: 2px solid var(--accent-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1;
    margin-top: 0;
}

.svc-popular-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* Pricing Typography */
.svc-price-header h3 {
    margin: 0;
    color: var(--primary-text);
    font-size: 1.2rem;
}

.svc-price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-text);
    margin: 15px 0 5px 0;
}

.svc-price-period {
    font-size: 1rem;
    color: #999;
    font-weight: 400;
}

.svc-price-sub {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 20px;
}

.svc-discount-text {
    color: var(--accent-color);
    font-size: 0.9rem;
    margin-top: -10px;
    margin-bottom: 15px;
    display: block;
}

/* Pricing Lists */
.svc-pricing-features {
    list-style: none;
    padding: 0;
    margin: 20px 0;
    text-align: left;
}

.svc-pricing-features li {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
    font-size: 0.9rem;
    color: var(--primary-text);
}

.svc-pricing-features li:last-child {
    border-bottom: none;
}

/* FAQ Section */
.svc-faq-section h3 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 1.4rem;
    color: var(--primary-text);
}

.svc-faq-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 30px;
}

.svc-faq-item strong {
    display: block;
    margin-bottom: 5px;
    font-size: 1rem;
    color: var(--primary-text);
}

.svc-faq-item p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

/* Helpers */
.svc-full-width {
    width: 100%;
    display: block;
    text-align: center;
}

/* ISA Specific Limits */
.svc-isa-layout {
    max-width: 500px;
    margin: 0 auto;
}

.large-btn {
    padding: 15px 30px;
    font-size: 1.1rem;
    display: inline-block;
}

.svc-spacer-top {
    margin-top: 50px;
}

/* ==========================================================================
   19. Twilio Dialer (ISA Only)
   ========================================================================== */

.text-muted {
    color: #6b7280; /* Gray-500 */
}

.text-small {
    font-size: 0.85rem;
}

.text-tiny {
    font-size: 0.75rem;
}

.mt-tiny {
    margin-top: 4px;
}

/* --- Component Specifics --- */
.saved-search-params {
    font-size: 0.85rem;
    margin-top: 4px;
    color: #6b7280;
}

.button.button-tiny {
    padding: 4px 10px;
    font-size: 0.75rem;
    line-height: 1.2;
    height: auto;
}

.dialer-controls {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Status Indicator */
.dialer-status {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
    font-style: italic;
    min-height: 20px; /* Prevents jump when text appears */
}

.dialer-status.error { color: #dc2626; }
.dialer-status.ready { color: #16a34a; }
.dialer-status.active { color: #2563eb; font-weight: 600; }

/* Hangup Button (Red) */
.button.hangup-btn {
    background: #fee2e2;
    color: #dc2626;
    border: 1px solid #dc2626;
}

.button.hangup-btn:hover {
    background: #fca5a5;
}

#btn-hangup {
    display: none;
}

.alert-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Container for the menu */
.user-menu-container {
    position: relative;
    display: inline-block;
    margin-left: 15px;
}

/* The Button Trigger */
.user-menu-toggle {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    padding: 7px;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-text, #333);
}

.user-menu-toggle:focus,
.user-menu-toggle:active {
    outline: none;
}

.user-menu-toggle:hover .user-name {
    text-decoration: underline;
}
    
.dropdown-arrow {
    font-size: 0.8em;
    opacity: 0.7;
}

/* The Dropdown Box */
.user-menu-dropdown {
    display: none; /* Hidden by default */
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    background-color: #fff;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-radius: 6px;
    border: 1px solid #eee;
    z-index: 1000;
    text-align: left;
}

/* Show class for JS */
.user-menu-dropdown.show {
    display: block;
}

/* Dropdown Items */
.user-menu-dropdown .dropdown-item {
    display: block;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
    cursor: pointer;
}

.user-menu-dropdown .dropdown-item:hover {
    background-color: #f5f5f5;
    color: var(--primary-color, #000); /* Uses your variable */
}

.dropdown-header {
    padding: 10px 15px;
    font-size: 0.85rem;
    color: #666;
    border-bottom: 1px solid #eee;
    background-color: #fafafa;
    border-radius: 6px 6px 0 0;
}

.dropdown-divider {
    height: 1px;
    background-color: #eee;
    margin: 4px 0;
}

.text-danger {
    color: #dc3545 !important;
}
    
/* Login Link styling to match nav */
.login-link {
    margin-left: 10px;
    font-weight: 600;
}

    /* --- SAVED SEARCHES DASHBOARD --- */

.dashboard-section {
    margin-bottom: 40px;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

/* Grid Layout */
.search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Card Style */
.search-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.search-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* Header & Rename Controls */
.search-header {
    margin-bottom: 15px;
}

.search-title-row, .search-edit-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    height: 30px; /* Fixed height prevents jump when switching */
}

.search-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: #333;
}

.search-name-input {
    flex-grow: 1;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.search-date {
    font-size: 0.85rem;
    color: #888;
    display: block;
    margin-top: 4px;
}

/* Icon Buttons */
.icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: #999;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
}
.icon-btn:hover { color: var(--primary-color, #000); background: #f5f5f5; }
.save-btn { color: #28a745; }
.cancel-btn { color: #dc3545; }

/* Stats & Criteria */
.search-stats {
    margin-bottom: 12px;
    font-size: 0.9rem;
    color: var(--primary-color, #000);
}

.search-criteria {
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes footer down */
}

.criteria-tag {
    display: inline-block;
    background: #f0f2f5;
    color: #555;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-right: 6px;
    margin-bottom: 6px;
}

/* Footer Actions */
.search-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}

.btn-run {
    text-decoration: none;
    background-color: var(--accent-color, #000);
    color: #fff;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}
.btn-run:hover { opacity: 0.9; }

.btn-text-danger {
    background: none;
    border: none;
    color: #dc3545; /* Standard Red */
    cursor: pointer;
    font-size: 0.85rem;
    text-decoration: underline;
}
.btn-text-danger:hover { color: #a71d2a; }

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

/* --- PROPERTY CARD CHAT DRAWER --- */

/* The Container (Hidden by default) */
.property-chat-drawer {
    border-top: 1px solid #f0f0f0;
    background-color: #fff;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.property-chat-drawer.hidden {
    display: none;
}

/* 1. SCROLLABLE HISTORY AREA */
.chat-history-area {
    padding: 15px;
    height: 300px;         /* Fixed height */
    overflow-y: auto;      /* Scrollable if content exceeds height */
    background-color: #f9f9f9;
    display: flex;
    flex-direction: column; /* Stacks bubbles vertically */
    gap: 10px;             /* Space between bubbles */
}

.chat-placeholder-text {
    color: #999;
    font-style: italic;
    text-align: center;
    margin-top: 20px;
}

/* Input Row */
.chat-input-row {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: #fff;
    border-top: 1px solid #eee;
    gap: 10px;
}

.chat-input-field {
    flex-grow: 1;
    background: #f0f2f5;
    border: none;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 0.95rem;
    outline: none;
    transition: background 0.2s;
}

.chat-input-field:focus {
    background: #e4e6eb;
}

.chat-send-btn {
    background-color: transparent;
    border: none;
    color: var(--primary-color, #007bff);
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}

.message-btn {
    position: relative;
    overflow: visible !important; /* Critical: Prevents clipping */
}

.chat-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 10px;
    height: 10px;
    background-color: #ff3b30;
    border-radius: 50%;
    border: 2px solid #fff;
    z-index: 10;
    display: block;
    pointer-events: none;
}

.chat-send-btn:hover {
    transform: scale(1.1);
}

.chat-send-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor; /* Uses the text color */
}

/* Timestamp inside bubble */
.chat-time {
    display: block;
    font-size: 0.7em;
    margin-top: 4px;
    opacity: 0.8;
    text-align: right;
}

/* Individual Message Bubbles (Future Proofing) */
.chat-bubble {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.4;
    position: relative;
    word-wrap: break-word;
}

/* My Messages (Right Side, Blue) */
.chat-bubble.mine {
    align-self: flex-end; /* Pushes to the right */
    background-color: var(--primary-color, #007bff);
    color: #fff;
    border-bottom-right-radius: 2px; /* Little "tail" effect */
}

/* Agent/System Messages (Left Side, Grey) */
.chat-bubble.agent {
    align-self: flex-start; /* Pushes to the left */
    background-color: #e9ecef;
    color: #333;
    border-bottom-left-radius: 2px;
}

.cp-message-list { list-style: none; padding: 0; margin: 0; }
.cp-message-item { 
    padding: 12px; 
    border-bottom: 1px solid #f0f0f0; 
    transition: background 0.2s;
}
.cp-message-item:last-child { border-bottom: none; }
.cp-message-item:hover { background-color: #f9f9f9; }

.msg-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    margin-bottom: 4px;
}
.msg-property-link {
    font-weight: 600;
    color: var(--primary-color, #333);
    text-decoration: none;
}
.msg-property-link:hover { text-decoration: underline; }
.msg-time { font-size: 0.75rem; color: #999; }

.msg-body { font-size: 0.9rem; color: #555; display: flex; align-items: center; gap: 5px; }
.msg-dot {
    width: 6px; height: 6px;
    background-color: #ff3b30;
    border-radius: 50%;
    display: inline-block;
}
.cp-footer-link {
    padding: 10px;
    text-align: center;
    font-size: 0.85rem;
    color: #999;
    font-style: italic;
}

/* --- RECOMMENDATION TRIAGE CARDS --- */

/* Grid Layout for these smaller cards */
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* Smaller min-width (200px vs 300px) */
    gap: 15px;
}

.recommendation-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
}

.rec-image-wrapper {
    position: relative;
    height: 140px; /* Shorter image */
    overflow: hidden;
}

.rec-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.rec-image-wrapper:hover img { transform: scale(1.05); }

.rec-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    background: #28a745; /* Green */
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.rec-content { padding: 10px; flex-grow: 1; }
.rec-price { font-weight: bold; font-size: 1rem; color: #333; }
.rec-address { color: #666; font-size: 0.85rem; margin-bottom: 4px; }
.rec-stats { font-size: 0.8rem; color: #888; }

/* Action Buttons Row */
.rec-actions {
    display: flex;
    border-top: 1px solid #eee;
}

.triage-btn {
    flex: 1; /* Split width 50/50 */
    border: none;
    background: transparent;
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-reject { color: #666; border-right: none; }
.btn-reject:hover { background-color: #f8d7da; color: #dc3545; }

.btn-accept { color: var(--accent-color, #007bff); border-right: 1px solid #eee; }
.btn-accept:hover { background-color: #d4edda; color: #28a745; }

/* --- PROFILE PAGE LAYOUT --- */

/* Center container */
.profile-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: inherit;
}

/* Header */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.profile-header h2 { margin: 0; font-size: 1.8rem; }
.back-link {
    text-decoration: none;
    color: #666;
    border: 1px solid #ddd;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: all 0.2s;
}
.back-link:hover { background: #f5f5f5; color: #333; }

/* Form Layout (Grid System) */
.profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two equal columns */
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Input Styling */
.profile-form input[type="text"],
.profile-form input[type="email"],
.profile-form input[type="tel"] {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%; /* Ensure it fills the grid cell */
    box-sizing: border-box; /* Includes padding in width calculation */
    transition: border-color 0.2s;
}

.profile-form input:focus {
    outline: none;
    border-color: var(--primary-color, #007bff);
}

.input-readonly {
    background-color: #f0f0f0;
    color: #888;
    cursor: not-allowed;
}

.helper-text { font-size: 0.75rem; color: #888; margin-top: 4px; }
.error-text { color: #dc3545; font-size: 0.8rem; margin-top: 4px; }

/* Buttons */
.form-actions {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end; /* Align button to the right */
}

.btn-save {
    background-color: var(--accent-color, #007bff);
    color: white;
    border: none;
    padding: 10px 24px;
    font-size: 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-save:hover { opacity: 0.9; }

/* Footer Link */
.profile-footer { margin-top: 20px; text-align: center; }
.profile-footer a { color: #666; font-size: 0.9rem; }

/* ==========================================================================
   20. Media Queries / Responsive Design
   ========================================================================== */
@media (max-width: 767px) {
    .footer-content {
        align-items: center;
        text-align: center;
    }

    .card-image {
        height: auto;
        padding: unset;
    }

    .gallery-arrow {
        width: 35px;
        height: 35px;
        font-size: 20px;
    }

    .gallery-arrow.prev { left: 10px; }
    .gallery-arrow.next { right: 10px; }

    .favorite-row,
    .favorite-row:nth-child(even) {
        flex-direction: column; /* Stack vertically always */
    }

    .fav-card-container,
    .favorite-row:nth-child(even) .fav-card-container {
        border-right: none;
        border-left: none;
        border-bottom: 1px solid var(--border-color);
        max-width: 100%;
    }

    .inbox-container {
        flex-direction: column;
        height: auto;
    }
    .inbox-sidebar {
        width: 100%;
        height: 300px; /* Fixed height sidebar on mobile */
    }

    .cp-grid {
        grid-template-columns: 1fr; /* Stack columns */
    }

    .cp-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .cp-header-actions {
        width: 100%;
    }

    .cp-header-actions .button {
        width: 100%;
        text-align: center;
    }

    .profile-grid { grid-template-columns: 1fr; }
}

@media (min-width: 768px) {
    /* --- LAYOUT --- */
    .footer-container {
        flex-direction: row; /* Side-by-side on desktop */
        justify-content: space-between;
        align-items: flex-start; /* Align to the top */
        text-align: left;
        gap: 30px;
    }

    .footer-content {
        flex: 1; /* Let the copyright section take up the other half */
        text-align: right;
    }

    .disclaimer-box {
        flex-direction: row;
        text-align: left;
    }

    /* --- GRIDS --- */
    .results-container .card-grid {
        grid-template-columns: 1fr;
    }

    .thumbnail-strip {
        display: flex;
        flex-wrap: wrap; /* This allows the grid layout */
        gap: 10px;
        justify-content: center; /* Center the thumbnails in the container */
    }

    .image-gallery .main-image {
        height: 500px;
    }

    .detail-header {
        flex-direction: row; /* Switch back to side-by-side */
        justify-content: space-between;
        align-items: flex-start;
    }

    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 Columns */
    }

    .main-column {
        grid-column: span 2; /* Full width on tablet */
    }

    .side-column {
        grid-column: span 2; /* Full width below main */
        display: grid;
        grid-template-columns: 1fr 1fr; /* Split side widgets into 2 columns */
        gap: 20px;
    }

    /* Tablet: 2 Columns for Features & FAQ */
    .svc-features-grid,
    .svc-faq-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* On Tablet, Ads pricing (3 cards) might need to wrap or stay 1col?
       Let's keep Ads pricing 1col or 2col on tablet, but 3 on desktop. */
    .svc-pricing-grid.svc-ads-layout {
        grid-template-columns: repeat(2, 1fr); /* 2 cols on tablet */
    }
    .svc-hero h1 {
        font-size: 2.2rem;
    }
    .featured-section .property-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    /* --- HEADER --- */
    .mobile-nav-toggle {
        display: none;
    }

    .main-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .main-nav-wrapper {
        display: flex !important;
        flex-direction: row;
        align-items: center;
        gap: 20px;
        position: static;
        width: auto;
        box-shadow: none;
        background: none;
        padding: 0;
    }

    .main-header nav {
        display: flex;
        flex-direction: row;
        gap: 20px;
    }

    .map-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 30px;
    }

    .map-container {
        flex: 5;
        position: sticky;
        top: 20px;
        height: calc(100vh - 40px);
    }

    .results-container {
        flex: 5;
    }

    /* --- GRID on map results page goes to 2 columns --- */
    .results-container .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-layout {
        flex-direction: row;
        align-items: flex-start;
        gap: 10px;
    }

    .detail-main-content {
        flex: 1; /* Main content takes ~70% of the width */
    }

    .detail-sidebar {
        flex-basis: 200px;
        flex-shrink: 0;
        position: sticky;
        top: 5px;
    }

    .dashboard-grid {
        grid-template-columns: repeat(4, 1fr); /* The full 4-column layout */
        grid-template-rows: auto 1fr;
    }

    /* Stats cards naturally fit into the 4 columns now */

    .main-column {
        grid-column: span 3; /* Left 3/4 */
    }

    .side-column {
        grid-column: span 1; /* Right 1/4 */
        display: flex; /* Revert back to stack for the sidebar */
        flex-direction: column;
    }

    /* Desktop: 3 Columns for Ads Pricing */
    .svc-pricing-grid.svc-ads-layout {
        grid-template-columns: repeat(3, 1fr);
    }

    /* ISA Features - maybe 4 across? */
    .svc-features-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Pop effect for featured card only works well on desktop/large screens */
    .svc-pricing-card.svc-featured {
        transform: scale(1.05);
    }
}

/* Large Desktops */
@media (min-width: 1440px) {
    .results-container .card-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}