/**
 * Military Directory — Contrast & UX Fixes (v1.4.0)
 *
 * This stylesheet patches WCAG AA contrast problems and readability issues
 * in the existing templates without rewriting the 5000-line frontend.css.
 *
 * Load order: leaflet → frontend.css → contrast-fixes.css (this file)
 *
 * Rules follow LVHA order (:link → :visited → :hover → :active) per project convention.
 */

/* ==========================================================================
   1. SKIP-TO-CONTENT LINK
   Currently visible by default — should only appear on keyboard focus.
   ========================================================================== */
.skip-link,
a.skip-link,
a[href="#content"].skip-link {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    z-index: 100000 !important;
}

.skip-link:focus,
a.skip-link:focus,
a[href="#content"].skip-link:focus {
    position: fixed !important;
    left: 1rem !important;
    top: 1rem !important;
    width: auto !important;
    height: auto !important;
    padding: 0.75rem 1.25rem !important;
    background: #0b1d3a !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25) !important;
    outline: 3px solid #facc15 !important;
    outline-offset: 2px !important;
}

/* ==========================================================================
   2. DARK HERO HEADINGS — AGENT PROFILE
   Theme's h1/h2/h3 selector wins over inherited `color: #fff` from parent.
   Force white on all heading elements inside dark hero sections.
   ========================================================================== */
.mda-hero,
.mda-hero * {
    color: #ffffff;
}
.mda-hero h1,
.mda-hero .mda-hero-info h1,
.mda-hero h2,
.mda-hero h3,
.mda-hero .mda-brokerage,
.mda-hero .mda-license {
    color: #ffffff !important;
}
.mda-hero .mda-brokerage {
    color: rgba(255,255,255,0.95) !important;
    font-weight: 500;
}
.mda-hero .mda-license {
    color: rgba(255,255,255,0.78) !important;
}

/* Secondary buttons on the dark hero — "Email Me" / "Website" */
.mda-contact-btn.secondary,
a.mda-contact-btn.secondary:link,
a.mda-contact-btn.secondary:visited {
    background: rgba(255,255,255,0.14) !important;
    color: #ffffff !important;
    border: 1.5px solid rgba(255,255,255,0.55) !important;
    font-weight: 600 !important;
}
a.mda-contact-btn.secondary:hover,
a.mda-contact-btn.secondary:active {
    background: #ffffff !important;
    color: #0f2439 !important;
    border-color: #ffffff !important;
    text-decoration: none !important;
}

/* Area-served tags — very low contrast blue-on-blue */
.mda-area-tag,
a.mda-area-tag:link,
a.mda-area-tag:visited {
    background: #dbeafe !important;
    color: #1e3a8a !important;
    font-weight: 600 !important;
    border: 1px solid #bfdbfe !important;
}
a.mda-area-tag:hover,
a.mda-area-tag:active {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    border-color: #1d4ed8 !important;
    text-decoration: none !important;
}

/* Agent CTA section — "Ready to Work with..." heading is dark on dark */
.mda-cta,
.mda-cta * {
    color: #ffffff;
}
.mda-cta h1,
.mda-cta h2,
.mda-cta h3,
.mda-cta h4 {
    color: #ffffff !important;
}
.mda-cta p {
    color: rgba(255,255,255,0.92) !important;
}
.mda-cta-btn.white,
a.mda-cta-btn.white:link,
a.mda-cta-btn.white:visited {
    background: #ffffff !important;
    color: #0f2439 !important;
    font-weight: 600 !important;
}
a.mda-cta-btn.white:hover,
a.mda-cta-btn.white:active {
    background: #facc15 !important;
    color: #0f2439 !important;
    text-decoration: none !important;
}

/* ==========================================================================
   3b. BUSINESS ARCHIVE (/directory/) — same theme h1 override issue
   archive-business.php uses .mdb-header with inherited color: #fff, but
   theme's h1 selector wins against inheritance. Force white.
   Note: .mdb-header here is a different class from .mdb-hero (single) —
   the .mdb- prefix is shared but suffixes differ, so no conflict.
   ========================================================================== */
.mdb-archive .mdb-header h1,
.mdb-archive .mdb-header h2,
.mdb-archive .mdb-header p {
    color: #ffffff !important;
}

/* Filter tags on archive — bump contrast slightly for safety */
.mdb-archive .mdb-filter-tag {
    color: #065f46 !important;
    background: #d1fae5 !important;
    border: 1px solid #a7f3d0 !important;
    font-weight: 600 !important;
}

/* Business cards on archive — match new design language */
.mdb-archive .mdb-card {
    border: 1px solid #e8ecf1 !important;
    box-shadow: 0 2px 8px rgba(15,29,47,0.08) !important;
}
.mdb-archive .mdb-card:hover {
    border-color: #cbd5e1 !important;
    box-shadow: 0 12px 28px rgba(15,29,47,0.14) !important;
}

/* ==========================================================================
   3c. BUSINESS LISTING — proper class-based styles (v1.2.0 refactor)
   The inline-style hero was replaced with real classes in single-business.php.
   These selectors are low-specificity and don't need !important.
   ========================================================================== */

/* Hero */
.mdb-hero {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2439 100%);
    color: #ffffff;
    padding: 2rem 1.5rem;
}
.mdb-hero-crumbs {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: rgba(255,255,255,0.85);
}
.mdb-hero-crumbs a,
.mdb-hero-crumbs a:link,
.mdb-hero-crumbs a:visited {
    color: rgba(255,255,255,0.85) !important;
    text-decoration: none;
}
.mdb-hero-crumbs a:hover,
.mdb-hero-crumbs a:active {
    color: #ffffff !important;
    text-decoration: underline;
}
.mdb-hero-crumbs span {
    color: #ffffff;
    font-weight: 500;
}
.mdb-hero-inner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.mdb-hero-logo {
    background: #ffffff;
    padding: 0.75rem;
    border-radius: 8px;
    flex-shrink: 0;
}
.mdb-hero-logo img {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
    display: block;
}
.mdb-hero-title,
.mdb-hero h1.mdb-hero-title {
    font-size: 2rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #ffffff !important;
    line-height: 1.2 !important;
}
.mdb-hero-slogan {
    margin: 0.375rem 0 0;
    font-style: italic;
    color: rgba(255,255,255,0.92);
    font-size: 0.9375rem;
}
.mdb-hero-badge {
    display: inline-block;
    background: #facc15;
    color: #0b1d3a !important;
    padding: 0.3125rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 0.625rem;
    letter-spacing: 0.02em;
}
.mdb-hero-serving {
    margin: 0.625rem 0 0;
    color: rgba(255,255,255,0.92);
    font-size: 0.9375rem;
}

/* Sidebar cards */
.mdb-side-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(15,29,47,0.06);
}
.mdb-side-card-head {
    padding: 0.875rem 1rem;
    text-align: center;
    font-weight: 700;
    font-size: 0.9375rem;
    color: #ffffff !important;
    letter-spacing: 0.01em;
}
.mdb-side-card-head--navy {
    background: #0f2439;
}
.mdb-side-card-body {
    padding: 1.25rem;
}
.mdb-side-contact-name {
    margin: 0 0 0.875rem;
    font-size: 0.875rem;
    color: #64748b;
    text-align: center;
}
.mdb-side-contact-name strong {
    color: #0f172a;
    font-weight: 700;
}
.mdb-side-contact-phone {
    margin: 0 0 0.5rem;
    font-size: 0.875rem;
    color: #475569;
    text-align: center;
}

/* Sidebar buttons */
.mdb-btn,
a.mdb-btn:link,
a.mdb-btn:visited {
    display: block;
    text-align: center;
    padding: 0.875rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 0.625rem;
    font-size: 0.9375rem;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}
.mdb-btn:last-child { margin-bottom: 0; }

a.mdb-btn-primary:link,
a.mdb-btn-primary:visited {
    background: #1d4ed8;
    color: #ffffff !important;
    font-weight: 700;
    font-size: 1rem;
}
a.mdb-btn-primary:hover,
a.mdb-btn-primary:active {
    background: #1558c5;
    color: #ffffff !important;
    text-decoration: none;
}

a.mdb-btn-success:link,
a.mdb-btn-success:visited {
    background: #047857;
    color: #ffffff !important;
}
a.mdb-btn-success:hover,
a.mdb-btn-success:active {
    background: #065f46;
    color: #ffffff !important;
    text-decoration: none;
}

a.mdb-btn-outline:link,
a.mdb-btn-outline:visited {
    background: #f8fafc;
    color: #0f172a !important;
    border: 1.5px solid #cbd5e1;
    font-weight: 600;
}
a.mdb-btn-outline:hover,
a.mdb-btn-outline:active {
    background: #0f172a;
    color: #ffffff !important;
    border-color: #0f172a;
    text-decoration: none;
}

/* Own a Business? CTA card */
.mdb-own-cta {
    background: linear-gradient(135deg, #1e3a5f 0%, #0f2439 100%);
    color: #ffffff;
    border-radius: 10px;
    padding: 1.75rem 1.5rem;
    text-align: center;
    box-shadow: 0 4px 14px rgba(15,29,47,0.12);
}
.mdb-own-cta-title,
.mdb-own-cta h3.mdb-own-cta-title {
    font-size: 1.125rem !important;
    font-weight: 700 !important;
    margin: 0 0 0.5rem !important;
    color: #ffffff !important;
}
.mdb-own-cta-text {
    font-size: 0.9375rem;
    color: rgba(255,255,255,0.92);
    margin: 0 0 1.125rem;
}
.mdb-own-cta-btn,
a.mdb-own-cta-btn:link,
a.mdb-own-cta-btn:visited {
    display: inline-block;
    background: #facc15;
    color: #0b1d3a !important;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.01em;
    transition: background 0.15s ease;
}
a.mdb-own-cta-btn:hover,
a.mdb-own-cta-btn:active {
    background: #eab308;
    color: #0b1d3a !important;
    text-decoration: none;
}

/* Legacy fallback: catch any remaining inline-styled dark headers we haven't
   refactored yet. Kept as a safety net — if a template still uses
   `style="background: #1e3a5f"` on some section we missed, headings still stay readable. */
[style*="background: #1e3a5f"] h1,
[style*="background: #1e3a5f"] h2,
[style*="background: #1e3a5f"] h3,
[style*="background:#1e3a5f"] h1,
[style*="background:#1e3a5f"] h2,
[style*="background:#1e3a5f"] h3 {
    color: #ffffff !important;
}
[style*="background: #1e3a5f"] p,
[style*="background: #1e3a5f"] nav,
[style*="background: #1e3a5f"] nav a {
    color: rgba(255,255,255,0.92) !important;
}

/* Category pills on business page body — light blue on light blue was too faint */
[style*="background: #eff6ff"][style*="color: #2563eb"] {
    background: #dbeafe !important;
    color: #1e3a8a !important;
    border: 1px solid #bfdbfe !important;
    font-weight: 600 !important;
}

/* ==========================================================================
   4. BASE-SINGLE PROPERTY PAGE — CORE UX FIXES
   Rewrites the `.bp-card` layout from overlay-on-photo → photo-on-top
   with content beneath. This is the single biggest readability win.
   ========================================================================== */

/* Widen the main container — theme is constraining to ~870px */
.bp .bp-main,
.bp-main,
.bp .bp-bottom,
.bp-bottom,
.bp .bp-about,
.bp-about,
.bp .bp-ads {
    max-width: 1320px !important;
}

/* Larger gap, better breathing room */
.bp .bp-main {
    gap: 2rem !important;
    padding: 2rem 1.5rem !important;
    grid-template-columns: 1fr 320px !important;
}

/* Grid: 3 columns stays, but larger gap so cards breathe */
.bp .bp-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 1.25rem !important;
}

/* CARD — redesigned: photo on top, content below */
.bp .bp-card {
    background: #ffffff !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(15,29,47,0.08) !important;
    border: 1px solid #e8ecf1 !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease !important;
    display: flex !important;
    flex-direction: column !important;
    text-decoration: none !important;
    color: inherit !important;
}
.bp .bp-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 12px 28px rgba(15,29,47,0.14) !important;
    border-color: #cbd5e1 !important;
    text-decoration: none !important;
}

/* Image block — ONLY holds the photo + tag badges. No gradient overlay covering content */
.bp .bp-card-img {
    aspect-ratio: 4/3 !important;
    position: relative !important;
    background: linear-gradient(135deg, #334155, #0f1d2f) !important;
    overflow: hidden !important;
}
.bp .bp-card-img img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* Tag badges — now positioned over photo only (not over text) */
.bp .bp-card-badges {
    position: absolute !important;
    top: 0.75rem !important;
    left: 0.75rem !important;
    display: flex !important;
    gap: 0.375rem !important;
    flex-wrap: wrap !important;
    z-index: 2 !important;
}
.bp .bp-tag {
    padding: 0.3125rem 0.625rem !important;
    font-size: 0.6875rem !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.05em !important;
    border-radius: 4px !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25) !important;
    line-height: 1 !important;
}

/* Distinct colors — sale is blue, rent is emerald green */
.bp .bp-tag-sale {
    background: #1d4ed8 !important;
    color: #ffffff !important;
}
.bp .bp-tag-rent {
    background: #047857 !important;
    color: #ffffff !important;
}
.bp .bp-tag-owner {
    background: rgba(255,255,255,0.97) !important;
    color: #0f172a !important;
    font-weight: 700 !important;
}
.bp .bp-tag-agent {
    background: #0f1d2f !important;
    color: #fbbf24 !important;
}
.bp .bp-tag-manager {
    background: #7c3aed !important;
    color: #ffffff !important;
}

/* Star button — keep on photo, improve visibility */
.bp .bp-card-star {
    top: 0.75rem !important;
    right: 0.75rem !important;
    width: 34px !important;
    height: 34px !important;
    background: rgba(255,255,255,0.92) !important;
    color: #64748b !important;
    border: none !important;
    border-radius: 50% !important;
    font-size: 1.125rem !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2) !important;
    transition: all 0.15s !important;
}
.bp .bp-card-star:hover {
    background: #ffffff !important;
    color: #f59e0b !important;
    transform: scale(1.08) !important;
}

/* Overlay — no longer used for content. Pull it out of the image block
   and reset it so inline HTML still renders, just without the dark gradient */
.bp .bp-card-overlay {
    position: static !important;
    background: #ffffff !important;
    padding: 1rem 1.125rem 1.125rem !important;
    color: #0f172a !important;
    z-index: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0.375rem !important;
}

/* Price: the most important info, make it dominant */
.bp .bp-card-overlay .bp-card-price,
.bp .bp-card-price {
    font-size: 1.375rem !important;
    font-weight: 700 !important;
    color: #0b1d3a !important;
    margin: 0 !important;
    font-family: 'DM Serif Display', Georgia, serif !important;
    line-height: 1.1 !important;
    order: 1 !important;
}

/* Specs: secondary info */
.bp .bp-card-overlay .bp-card-specs,
.bp .bp-card-specs {
    font-size: 0.875rem !important;
    color: #334155 !important;
    margin: 0 !important;
    font-weight: 500 !important;
    order: 2 !important;
}

/* Address: tertiary info */
.bp .bp-card-overlay .bp-card-addr,
.bp .bp-card-addr {
    font-size: 0.8125rem !important;
    color: #64748b !important;
    margin: 0 !important;
    text-transform: none !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 1.4 !important;
    opacity: 1 !important;
    order: 3 !important;
    padding-top: 0.25rem !important;
    border-top: 1px solid #f1f5f9 !important;
    margin-top: 0.25rem !important;
}

/* Placeholder (no-photo) — make it cleaner */
.bp .bp-placeholder {
    background: linear-gradient(135deg, #1e3a5f, #0f1d2f) !important;
    color: #94a3b8 !important;   /* decorative placeholder icon */
    font-size: 3rem !important;
}

/* ==========================================================================
   5. BASE-SINGLE TYPOGRAPHY — make everything readable
   ========================================================================== */
.bp .bp-name {
    font-size: 2rem !important;
    line-height: 1.2 !important;
    color: #0a0f1a !important;
}
.bp .bp-subtitle {
    font-size: 0.75rem !important;
    color: #1d4ed8 !important;
    font-weight: 700 !important;
}
.bp .bp-crumb {
    font-size: 0.875rem !important;
    color: #475569 !important;
}
.bp .bp-crumb a {
    color: #475569 !important;
}
.bp .bp-crumb a:hover {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}
.bp .bp-results-count {
    font-size: 0.9375rem !important;
    color: #475569 !important;
}
.bp .bp-results-count strong {
    font-size: 1rem !important;
    color: #0f172a !important;
}

/* About section at bottom of base page */
.bp .bp-about p {
    font-size: 0.9375rem !important;
    color: #334155 !important;
    line-height: 1.7 !important;
}

/* Bottom "useful links" sections */
.bp .bp-bottom h3 {
    font-size: 0.75rem !important;
    color: #334155 !important;
}
.bp .bp-bottom a {
    font-size: 0.875rem !important;
    color: #1d4ed8 !important;
}
.bp .bp-bottom a:hover {
    color: #1558c5 !important;
    text-decoration: underline !important;
}

/* ==========================================================================
   6. BASE-SINGLE SIDEBAR — "Register as Agent" button contrast fix
   ========================================================================== */
.bp .bp-side-head.emerald {
    background: #047857 !important;
}
.bp .bp-side-head.emerald span {
    color: #ffffff !important;
    font-weight: 700 !important;
}
/* The CTA button on green card needs clear visibility */
.bp .bp-side-cta,
a.bp-side-cta:link,
a.bp-side-cta:visited {
    background: #047857 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
}
a.bp-side-cta:hover,
a.bp-side-cta:active {
    background: #065f46 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

.bp .bp-side-head span {
    color: #334155 !important;
}
.bp .bp-side-link {
    font-size: 0.875rem !important;
    color: #1d4ed8 !important;
}
.bp .bp-side-link:hover {
    color: #1558c5 !important;
    text-decoration: underline !important;
}

/* ==========================================================================
   7. BASE-SINGLE FILTER BAR — improve readability
   ========================================================================== */
.bp .bp-fbtn {
    font-size: 0.75rem !important;
    color: rgba(255,255,255,0.88) !important;
    letter-spacing: 0.04em !important;
}
.bp .bp-fbtn:hover {
    color: #ffffff !important;
    background: rgba(255,255,255,0.08) !important;
}
.bp .bp-clear {
    color: rgba(255,255,255,0.7) !important;
    font-size: 0.75rem !important;
}
.bp .bp-clear:hover {
    color: #ffffff !important;
}
.bp .bp-add,
a.bp-add:link,
a.bp-add:visited {
    background: #047857 !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
}
a.bp-add:hover,
a.bp-add:active {
    background: #065f46 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Sort bar labels */
.bp .bp-sort label {
    font-size: 0.75rem !important;
    color: #334155 !important;
}
.bp .bp-save button {
    background: #1d4ed8 !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
}
.bp .bp-save button:hover {
    background: #1558c5 !important;
}

/* ==========================================================================
   8. STATE ARCHIVE PAGE — Military Housing in [State]
   Widen layout, improve dark-header contrast, fix "MORE BASE HOUSING DETAILS" buttons
   ========================================================================== */
.mdir-state-archive {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 1.5rem !important;
}
.mdir-state-archive h1 {
    color: #0a0f1a !important;
}
/* If the state header has a dark nav blue background, ensure heading is white */
.mdir-state-archive [style*="background"][style*="#1258"] h1,
.mdir-state-archive [style*="background"][style*="#0B1D"] h1,
.mdir-state-archive [style*="background"][style*="#1e3a"] h1 {
    color: #ffffff !important;
}
.mdir-state-archive .mdir-base-card a.mdir-base-link,
.mdir-state-archive a[class*="housing-details"] {
    font-weight: 700 !important;
}

/* ==========================================================================
   9. HOMEPAGE LISTINGS GRID (via [military_directory_listings] shortcode)
   v1.2.0 fixed the data bug where this shortcode used wrong meta keys.
   This styles the new mdir-listing-* markup to match the redesigned base cards.
   ========================================================================== */
.mdir-listings-grid {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}
.mdir-listing-card,
a.mdir-listing-card:link,
a.mdir-listing-card:visited {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15,29,47,0.08);
    border: 1px solid #e8ecf1;
    text-decoration: none;
    color: inherit !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
a.mdir-listing-card:hover,
a.mdir-listing-card:active {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(15,29,47,0.14);
    border-color: #cbd5e1;
    text-decoration: none !important;
    color: inherit !important;
}

.mdir-listing-card-img {
    position: relative;
    aspect-ratio: 4/3;
    background: linear-gradient(135deg, #334155, #0f1d2f);
    overflow: hidden;
}
.mdir-listing-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.mdir-listing-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #94a3b8;
}

.mdir-listing-tag {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.3125rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
    line-height: 1;
    color: #ffffff;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.mdir-listing-tag-sale { background: #1d4ed8; }
.mdir-listing-tag-rent { background: #047857; }

.mdir-listing-card-body {
    padding: 1rem 1.125rem 1.125rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
}
.mdir-listing-price {
    font-size: 1.375rem;
    font-weight: 700;
    color: #0b1d3a;
    margin: 0;
    font-family: 'DM Serif Display', Georgia, serif;
    line-height: 1.1;
}
.mdir-listing-price-sfx {
    font-size: 0.875rem;
    font-weight: 400;
    color: #475569;
    font-family: inherit;
}
.mdir-listing-specs {
    font-size: 0.875rem;
    color: #334155;
    margin: 0;
    font-weight: 500;
}
.mdir-listing-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #0b1d3a;
    margin: 0.25rem 0 0;
    line-height: 1.35;
    letter-spacing: normal;
    text-transform: none;
}
.mdir-listing-location {
    font-size: 0.8125rem;
    color: #64748b;
    margin: 0;
    padding-top: 0.25rem;
    border-top: 1px solid #f1f5f9;
    margin-top: 0.25rem;
}
.mdir-listings-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px dashed #cbd5e1;
}

/* Legacy selectors kept as fallback for any generic .md-property-card usage */
.md-property-card,
.md-listing-card,
.md-homepage-listing {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(15,29,47,0.08);
    border: 1px solid #e8ecf1;
    padding: 1rem 1.25rem;
    min-height: auto !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: all 0.2s ease;
}
.md-property-card:hover,
.md-listing-card:hover,
.md-homepage-listing:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(15,29,47,0.12);
    border-color: #cbd5e1;
}
.md-property-card a,
.md-listing-card a {
    color: #0b1d3a;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9375rem;
    line-height: 1.35;
    display: block;
}
.md-property-card a:hover,
.md-listing-card a:hover {
    color: #1d4ed8;
    text-decoration: none;
}

/* ==========================================================================
   10. SEARCH / ARCHIVE GENERIC CARDS
   For any generic .md-card used across archives
   ========================================================================== */
.md-card {
    background: #ffffff;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 1px 3px rgba(15,29,47,0.06) !important;
    transition: all 0.2s ease !important;
}
.md-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(15,29,47,0.1) !important;
    border-color: #cbd5e1 !important;
}
.md-card-title {
    color: #0b1d3a;
}
.md-card-title a,
.md-card-title a:link,
.md-card-title a:visited {
    color: #0b1d3a !important;
}
.md-card-title a:hover,
.md-card-title a:active {
    color: #1d4ed8 !important;
    text-decoration: underline !important;
}

/* Generic body text in cards */
.md-card-meta,
.md-card-body p {
    color: #475569 !important;
}

/* ==========================================================================
   11. FOCUS RING — stronger keyboard focus for accessibility
   ========================================================================== */
.bp a:focus-visible,
.bp button:focus-visible,
.bp input:focus-visible,
.bp select:focus-visible,
.mda-profile a:focus-visible,
.mda-profile button:focus-visible,
.md-card a:focus-visible,
.md-card button:focus-visible {
    outline: 3px solid #facc15 !important;
    outline-offset: 2px !important;
    border-radius: 4px;
}

/* ==========================================================================
   12. RESPONSIVE — tighten the card grid on smaller screens
   ========================================================================== */
@media (max-width: 1100px) {
    .bp .bp-main {
        grid-template-columns: 1fr !important;
    }
    .bp .bp-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 768px) {
    .bp .bp-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1rem !important;
    }
    .bp .bp-main {
        padding: 1rem !important;
    }
    .bp .bp-card-overlay .bp-card-price,
    .bp .bp-card-price {
        font-size: 1.125rem !important;
    }
}
@media (max-width: 480px) {
    .bp .bp-grid {
        grid-template-columns: 1fr !important;
    }
    .bp .bp-name {
        font-size: 1.5rem !important;
    }
}

/* ==========================================================================
   13. PRINT — clean printed layout
   ========================================================================== */
@media print {
    .bp-filter,
    .bp-card-star,
    .mda-contact-row,
    .mda-cta,
    .bp-ads {
        display: none !important;
    }
    .bp .bp-card,
    .md-card {
        break-inside: avoid;
        box-shadow: none !important;
        border: 1px solid #000 !important;
    }
}

/* ==========================================================================
   v1.3.0 — HOST THEME OVERRIDE HARDENING
   
   The active theme sets a crimson link/button colour with enough specificity
   to beat the plugin's own class rules. The result: hero tabs and the
   geolocate button rendered as crimson text on white with a crimson border,
   despite frontend.css declaring correct pairs. Background survived, colour
   and border did not.
   
   Every rule below declares background, text colour AND border together, in
   every state, so no single property can be picked off by a theme. Ratios are
   measured, not estimated.
   ========================================================================== */

/* --- Hero search tabs ---------------------------------------------------- */
.mbo-tabs .mbo-tab,
button.mbo-tab {
    border: 2px solid transparent !important;
    text-decoration: none !important;
    text-shadow: none !important;
    font-family: inherit !important;
}

/* Buy — dark on white, 17.40:1 */
.mbo-tabs .mbo-tab-buy,
button.mbo-tab.mbo-tab-buy {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    border-color: #ffffff !important;
}
.mbo-tabs .mbo-tab-buy:hover,
.mbo-tabs .mbo-tab-buy:focus,
button.mbo-tab.mbo-tab-buy:hover,
button.mbo-tab.mbo-tab-buy:focus {
    background-color: #e2e8f0 !important;   /* 14.12:1 */
    color: #1a1a1a !important;
    border-color: #e2e8f0 !important;
}

/* Rent — dark on amber, 8.10:1. Was white on #d97706 at 5.46:1 (AA only). */
.mbo-tabs .mbo-tab-rent,
button.mbo-tab.mbo-tab-rent {
    background-color: #f59e0b !important;
    color: #1a1a1a !important;
    border-color: #f59e0b !important;
}
.mbo-tabs .mbo-tab-rent:hover,
.mbo-tabs .mbo-tab-rent:focus,
button.mbo-tab.mbo-tab-rent:hover,
button.mbo-tab.mbo-tab-rent:focus {
    background-color: #fbbf24 !important;
    color: #1a1a1a !important;
    border-color: #fbbf24 !important;
}

/* Advertise — white on slate, 14.63:1 */
.mbo-tabs .mbo-tab-advertise,
button.mbo-tab.mbo-tab-advertise {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
}
.mbo-tabs .mbo-tab-advertise:hover,
.mbo-tabs .mbo-tab-advertise:focus,
button.mbo-tab.mbo-tab-advertise:hover,
button.mbo-tab.mbo-tab-advertise:focus {
    background-color: #0f172a !important;   /* 17.85:1 */
    color: #ffffff !important;
    border-color: #0f172a !important;
}

/* Selected tab needs a non-colour cue, not just the underline. */
.mbo-tabs .mbo-tab[aria-selected="true"] {
    box-shadow: inset 0 -4px 0 #ffffff !important;
    font-weight: 700 !important;
}

/* --- Geolocate button ---------------------------------------------------- */
/* Was translucent white over navy, which the theme repainted crimson.
   Solid white on navy, 15.77:1. */
.mbo-geo-bar .mbo-geo-btn,
button.mbo-geo-btn {
    background-color: #ffffff !important;
    color: #0f2439 !important;
    border: 2px solid #ffffff !important;
    text-decoration: none !important;
}
.mbo-geo-bar .mbo-geo-btn:hover,
.mbo-geo-bar .mbo-geo-btn:focus,
button.mbo-geo-btn:hover,
button.mbo-geo-btn:focus {
    background-color: #dbeafe !important;
    color: #0f2439 !important;
    border-color: #dbeafe !important;
}
.mbo-geo-btn svg {
    stroke: currentColor !important;
    fill: none !important;
}

/* --- Hero selects -------------------------------------------------------- */
.mbo-search-box select,
.mbo-base-select select,
.mbo-hero select {
    background-color: #ffffff !important;
    color: #1a1a1a !important;
    border: 2px solid #cbd5e1 !important;
}
.mbo-search-box select:focus,
.mbo-base-select select:focus,
.mbo-hero select:focus {
    border-color: #1e40af !important;
    outline: 3px solid #1e40af !important;
    outline-offset: 2px !important;
}

/* --- Map labels ---------------------------------------------------------- */
/* Label colour now ships per-state from fill_for_count(). This is the
   fallback for states with no bases, on the lightest fill. */
.state-label {
    fill: #0f172a !important;
    text-shadow: none !important;
    font-weight: 700 !important;
}
.state-group:hover .state-shape,
.state-group:focus .state-shape {
    fill: #1e40af !important;
}
.state-group:hover .state-label,
.state-group:focus .state-label {
    fill: #ffffff !important;   /* 8.72:1 on #1e40af */
}
.state-group:focus {
    outline: 3px solid #0f172a !important;
    outline-offset: 2px !important;
}

/* --- Supporting text ----------------------------------------------------- */
/* #64748b measured 4.76:1 — AA but not AAA. #475569 is 7.58:1. */
.mdir-listings-empty,
.md-text-slate-500,
.mdir-map-status,
.mdir-map-help {
    color: #475569 !important;
}

/* --- Branch filter legend ------------------------------------------------ */
.mdir-map-legend label {
    color: #1e293b !important;
}
.mdir-map-legend input[type="checkbox"]:focus + span,
.mdir-map-legend input[type="checkbox"]:focus {
    outline: 3px solid #1e40af !important;
    outline-offset: 2px !important;
}

/* --- Keyboard focus floor ------------------------------------------------ */
.mbo-tab:focus-visible,
.mbo-geo-btn:focus-visible,
.mbo-state-btn:focus-visible {
    outline: 3px solid #ffffff !important;
    outline-offset: 3px !important;
}

@media (prefers-reduced-motion: reduce) {
    .mbo-tab,
    .mbo-geo-btn,
    .state-shape {
        transition: none !important;
    }
}

/* ==========================================================================
   v1.4.0 — SITE-WIDE BUTTON PAIRING
   
   An audit of frontend.css found 23 button rules that set a background with no
   text colour, and 14 that set a text colour with no background. Where the
   plugin repaints only the background, the host theme's dark text survives on
   top of it — dark on dark, invisible.
   
   Ten pairs also measured below AA, the worst being #fff on #94a3b8 at 2.56:1.
   
   Every button role below declares background, text colour and border together
   in all six states: rest, hover, focus, active, visited and disabled. All
   ratios measured and at AAA (>=7:1).
   ========================================================================== */

/* --- primary: #ffffff on #1e40af = 8.72:1 | hover #ffffff on #1e3a8a = 10.36:1 --- */
.md-btn-primary,
.mde-btn-primary,
.md-admin-btn-primary,
.md-bases-btn-primary,
.mda-btn-search,
.md-account-btn,
.md-search-btn,
.md-search-btn.ready,
.mbo-agent-form .btn-primary,
.mda-cta-btn,
.msa-cta-btn,
.mbo-ad-btn,
.sp-cta-btn,
.md-package-btn,
.mda-view-btn,
.mdb-btn {
    background-color: #1e40af !important;
    color: #ffffff !important;
    border-color: #1e40af !important;
    text-decoration: none !important;
    text-shadow: none !important;
}
.md-btn-primary:visited,
.mde-btn-primary:visited,
.md-admin-btn-primary:visited,
.md-bases-btn-primary:visited,
.mda-btn-search:visited,
.md-account-btn:visited,
.md-search-btn:visited,
.md-search-btn.ready:visited,
.mbo-agent-form .btn-primary:visited,
.mda-cta-btn:visited,
.msa-cta-btn:visited,
.mbo-ad-btn:visited,
.sp-cta-btn:visited,
.md-package-btn:visited,
.mda-view-btn:visited,
.mdb-btn:visited {
    background-color: #1e40af !important;
    color: #ffffff !important;
    border-color: #1e40af !important;
}
.md-btn-primary:hover,
.mde-btn-primary:hover,
.md-admin-btn-primary:hover,
.md-bases-btn-primary:hover,
.mda-btn-search:hover,
.md-account-btn:hover,
.md-search-btn:hover,
.md-search-btn.ready:hover,
.mbo-agent-form .btn-primary:hover,
.mda-cta-btn:hover,
.msa-cta-btn:hover,
.mbo-ad-btn:hover,
.sp-cta-btn:hover,
.md-package-btn:hover,
.mda-view-btn:hover,
.mdb-btn:hover,
.md-btn-primary:focus,
.mde-btn-primary:focus,
.md-admin-btn-primary:focus,
.md-bases-btn-primary:focus,
.mda-btn-search:focus,
.md-account-btn:focus,
.md-search-btn:focus,
.md-search-btn.ready:focus,
.mbo-agent-form .btn-primary:focus,
.mda-cta-btn:focus,
.msa-cta-btn:focus,
.mbo-ad-btn:focus,
.sp-cta-btn:focus,
.md-package-btn:focus,
.mda-view-btn:focus,
.mdb-btn:focus {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    border-color: #1e3a8a !important;
}
.md-btn-primary:active,
.mde-btn-primary:active,
.md-admin-btn-primary:active,
.md-bases-btn-primary:active,
.mda-btn-search:active,
.md-account-btn:active,
.md-search-btn:active,
.md-search-btn.ready:active,
.mbo-agent-form .btn-primary:active,
.mda-cta-btn:active,
.msa-cta-btn:active,
.mbo-ad-btn:active,
.sp-cta-btn:active,
.md-package-btn:active,
.mda-view-btn:active,
.mdb-btn:active {
    background-color: #1e3a8a !important;
    color: #ffffff !important;
    border-color: #1e3a8a !important;
}
.md-btn-primary:disabled,
.mde-btn-primary:disabled,
.md-admin-btn-primary:disabled,
.md-bases-btn-primary:disabled,
.mda-btn-search:disabled,
.md-account-btn:disabled,
.md-search-btn:disabled,
.md-search-btn.ready:disabled,
.mbo-agent-form .btn-primary:disabled,
.mda-cta-btn:disabled,
.msa-cta-btn:disabled,
.mbo-ad-btn:disabled,
.sp-cta-btn:disabled,
.md-package-btn:disabled,
.mda-view-btn:disabled,
.mdb-btn:disabled,
.md-btn-primary[aria-disabled="true"],
.mde-btn-primary[aria-disabled="true"],
.md-admin-btn-primary[aria-disabled="true"],
.md-bases-btn-primary[aria-disabled="true"],
.mda-btn-search[aria-disabled="true"],
.md-account-btn[aria-disabled="true"],
.md-search-btn[aria-disabled="true"],
.md-search-btn.ready[aria-disabled="true"],
.mbo-agent-form .btn-primary[aria-disabled="true"],
.mda-cta-btn[aria-disabled="true"],
.msa-cta-btn[aria-disabled="true"],
.mbo-ad-btn[aria-disabled="true"],
.sp-cta-btn[aria-disabled="true"],
.md-package-btn[aria-disabled="true"],
.mda-view-btn[aria-disabled="true"],
.mdb-btn[aria-disabled="true"] {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* --- success: #ffffff on #065f46 = 7.68:1 | hover #ffffff on #064e3b = 9.72:1 --- */
.md-advertise-cta a,
.mda-btn-add,
.md-type-btn.selected.sale-btn,
.mbo-add-listing-btn,
.mbo-submit-form .btn-primary,
.mbo-business-form .btn-primary {
    background-color: #065f46 !important;
    color: #ffffff !important;
    border-color: #065f46 !important;
    text-decoration: none !important;
    text-shadow: none !important;
}
.md-advertise-cta a:visited,
.mda-btn-add:visited,
.md-type-btn.selected.sale-btn:visited,
.mbo-add-listing-btn:visited,
.mbo-submit-form .btn-primary:visited,
.mbo-business-form .btn-primary:visited {
    background-color: #065f46 !important;
    color: #ffffff !important;
    border-color: #065f46 !important;
}
.md-advertise-cta a:hover,
.mda-btn-add:hover,
.md-type-btn.selected.sale-btn:hover,
.mbo-add-listing-btn:hover,
.mbo-submit-form .btn-primary:hover,
.mbo-business-form .btn-primary:hover,
.md-advertise-cta a:focus,
.mda-btn-add:focus,
.md-type-btn.selected.sale-btn:focus,
.mbo-add-listing-btn:focus,
.mbo-submit-form .btn-primary:focus,
.mbo-business-form .btn-primary:focus {
    background-color: #064e3b !important;
    color: #ffffff !important;
    border-color: #064e3b !important;
}
.md-advertise-cta a:active,
.mda-btn-add:active,
.md-type-btn.selected.sale-btn:active,
.mbo-add-listing-btn:active,
.mbo-submit-form .btn-primary:active,
.mbo-business-form .btn-primary:active {
    background-color: #064e3b !important;
    color: #ffffff !important;
    border-color: #064e3b !important;
}
.md-advertise-cta a:disabled,
.mda-btn-add:disabled,
.md-type-btn.selected.sale-btn:disabled,
.mbo-add-listing-btn:disabled,
.mbo-submit-form .btn-primary:disabled,
.mbo-business-form .btn-primary:disabled,
.md-advertise-cta a[aria-disabled="true"],
.mda-btn-add[aria-disabled="true"],
.md-type-btn.selected.sale-btn[aria-disabled="true"],
.mbo-add-listing-btn[aria-disabled="true"],
.mbo-submit-form .btn-primary[aria-disabled="true"],
.mbo-business-form .btn-primary[aria-disabled="true"] {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* --- danger: #ffffff on #991b1b = 8.31:1 | hover #ffffff on #7f1d1d = 10.02:1 --- */
.mdir-btn-danger,
.md-admin-btn-danger,
.md-btn-logout,
.mdir-action-btn.mdir-btn-delete {
    background-color: #991b1b !important;
    color: #ffffff !important;
    border-color: #991b1b !important;
    text-decoration: none !important;
    text-shadow: none !important;
}
.mdir-btn-danger:visited,
.md-admin-btn-danger:visited,
.md-btn-logout:visited,
.mdir-action-btn.mdir-btn-delete:visited {
    background-color: #991b1b !important;
    color: #ffffff !important;
    border-color: #991b1b !important;
}
.mdir-btn-danger:hover,
.md-admin-btn-danger:hover,
.md-btn-logout:hover,
.mdir-action-btn.mdir-btn-delete:hover,
.mdir-btn-danger:focus,
.md-admin-btn-danger:focus,
.md-btn-logout:focus,
.mdir-action-btn.mdir-btn-delete:focus {
    background-color: #7f1d1d !important;
    color: #ffffff !important;
    border-color: #7f1d1d !important;
}
.mdir-btn-danger:active,
.md-admin-btn-danger:active,
.md-btn-logout:active,
.mdir-action-btn.mdir-btn-delete:active {
    background-color: #7f1d1d !important;
    color: #ffffff !important;
    border-color: #7f1d1d !important;
}
.mdir-btn-danger:disabled,
.md-admin-btn-danger:disabled,
.md-btn-logout:disabled,
.mdir-action-btn.mdir-btn-delete:disabled,
.mdir-btn-danger[aria-disabled="true"],
.md-admin-btn-danger[aria-disabled="true"],
.md-btn-logout[aria-disabled="true"],
.mdir-action-btn.mdir-btn-delete[aria-disabled="true"] {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* --- warning: #1a1a1a on #f59e0b = 8.10:1 | hover #1a1a1a on #fbbf24 = 10.43:1 --- */
.md-type-btn.selected.rent-btn,
.mbo-tab-rent {
    background-color: #f59e0b !important;
    color: #1a1a1a !important;
    border-color: #f59e0b !important;
    text-decoration: none !important;
    text-shadow: none !important;
}
.md-type-btn.selected.rent-btn:visited,
.mbo-tab-rent:visited {
    background-color: #f59e0b !important;
    color: #1a1a1a !important;
    border-color: #f59e0b !important;
}
.md-type-btn.selected.rent-btn:hover,
.mbo-tab-rent:hover,
.md-type-btn.selected.rent-btn:focus,
.mbo-tab-rent:focus {
    background-color: #fbbf24 !important;
    color: #1a1a1a !important;
    border-color: #fbbf24 !important;
}
.md-type-btn.selected.rent-btn:active,
.mbo-tab-rent:active {
    background-color: #fbbf24 !important;
    color: #1a1a1a !important;
    border-color: #fbbf24 !important;
}
.md-type-btn.selected.rent-btn:disabled,
.mbo-tab-rent:disabled,
.md-type-btn.selected.rent-btn[aria-disabled="true"],
.mbo-tab-rent[aria-disabled="true"] {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* --- neutral: #1a1a1a on #e2e8f0 = 14.12:1 | hover #1a1a1a on #cbd5e1 = 11.72:1 --- */
.mde-btn-secondary,
.md-bases-btn-secondary,
.mda-btn-clear,
.btn-secondary,
.md-package-btn-secondary,
.mbo-filter-btn,
.md-lt-btn,
.mbo-clear-btn {
    background-color: #e2e8f0 !important;
    color: #1a1a1a !important;
    border-color: #e2e8f0 !important;
    text-decoration: none !important;
    text-shadow: none !important;
}
.mde-btn-secondary:visited,
.md-bases-btn-secondary:visited,
.mda-btn-clear:visited,
.btn-secondary:visited,
.md-package-btn-secondary:visited,
.mbo-filter-btn:visited,
.md-lt-btn:visited,
.mbo-clear-btn:visited {
    background-color: #e2e8f0 !important;
    color: #1a1a1a !important;
    border-color: #e2e8f0 !important;
}
.mde-btn-secondary:hover,
.md-bases-btn-secondary:hover,
.mda-btn-clear:hover,
.btn-secondary:hover,
.md-package-btn-secondary:hover,
.mbo-filter-btn:hover,
.md-lt-btn:hover,
.mbo-clear-btn:hover,
.mde-btn-secondary:focus,
.md-bases-btn-secondary:focus,
.mda-btn-clear:focus,
.btn-secondary:focus,
.md-package-btn-secondary:focus,
.mbo-filter-btn:focus,
.md-lt-btn:focus,
.mbo-clear-btn:focus {
    background-color: #cbd5e1 !important;
    color: #1a1a1a !important;
    border-color: #cbd5e1 !important;
}
.mde-btn-secondary:active,
.md-bases-btn-secondary:active,
.mda-btn-clear:active,
.btn-secondary:active,
.md-package-btn-secondary:active,
.mbo-filter-btn:active,
.md-lt-btn:active,
.mbo-clear-btn:active {
    background-color: #cbd5e1 !important;
    color: #1a1a1a !important;
    border-color: #cbd5e1 !important;
}
.mde-btn-secondary:disabled,
.md-bases-btn-secondary:disabled,
.mda-btn-clear:disabled,
.btn-secondary:disabled,
.md-package-btn-secondary:disabled,
.mbo-filter-btn:disabled,
.md-lt-btn:disabled,
.mbo-clear-btn:disabled,
.mde-btn-secondary[aria-disabled="true"],
.md-bases-btn-secondary[aria-disabled="true"],
.mda-btn-clear[aria-disabled="true"],
.btn-secondary[aria-disabled="true"],
.md-package-btn-secondary[aria-disabled="true"],
.mbo-filter-btn[aria-disabled="true"],
.md-lt-btn[aria-disabled="true"],
.mbo-clear-btn[aria-disabled="true"] {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* --- dark: #ffffff on #1e293b = 14.63:1 | hover #ffffff on #0f172a = 17.85:1 --- */
.sp-cta-navy,
.md-backend-action,
.mda-contact-btn,
.sp-share-btn,
.sp-tool-btn,
.bp-fbtn {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
    text-decoration: none !important;
    text-shadow: none !important;
}
.sp-cta-navy:visited,
.md-backend-action:visited,
.mda-contact-btn:visited,
.sp-share-btn:visited,
.sp-tool-btn:visited,
.bp-fbtn:visited {
    background-color: #1e293b !important;
    color: #ffffff !important;
    border-color: #1e293b !important;
}
.sp-cta-navy:hover,
.md-backend-action:hover,
.mda-contact-btn:hover,
.sp-share-btn:hover,
.sp-tool-btn:hover,
.bp-fbtn:hover,
.sp-cta-navy:focus,
.md-backend-action:focus,
.mda-contact-btn:focus,
.sp-share-btn:focus,
.sp-tool-btn:focus,
.bp-fbtn:focus {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
}
.sp-cta-navy:active,
.md-backend-action:active,
.mda-contact-btn:active,
.sp-share-btn:active,
.sp-tool-btn:active,
.bp-fbtn:active {
    background-color: #0f172a !important;
    color: #ffffff !important;
    border-color: #0f172a !important;
}
.sp-cta-navy:disabled,
.md-backend-action:disabled,
.mda-contact-btn:disabled,
.sp-share-btn:disabled,
.sp-tool-btn:disabled,
.bp-fbtn:disabled,
.sp-cta-navy[aria-disabled="true"],
.md-backend-action[aria-disabled="true"],
.mda-contact-btn[aria-disabled="true"],
.sp-share-btn[aria-disabled="true"],
.sp-tool-btn[aria-disabled="true"],
.bp-fbtn[aria-disabled="true"] {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* --- outline: #1e40af on #ffffff = 8.72:1 | hover #1e40af on #eff6ff = 8.01:1 --- */
.md-btn-outline,
.md-admin-btn-outline,
.mdb-btn-outline,
.mdir-action-btn,
.mdir-gallery-add-btn {
    background-color: #ffffff !important;
    color: #1e40af !important;
    border-color: #ffffff !important;
    text-decoration: none !important;
    text-shadow: none !important;
}
.md-btn-outline:visited,
.md-admin-btn-outline:visited,
.mdb-btn-outline:visited,
.mdir-action-btn:visited,
.mdir-gallery-add-btn:visited {
    background-color: #ffffff !important;
    color: #1e40af !important;
    border-color: #ffffff !important;
}
.md-btn-outline:hover,
.md-admin-btn-outline:hover,
.mdb-btn-outline:hover,
.mdir-action-btn:hover,
.mdir-gallery-add-btn:hover,
.md-btn-outline:focus,
.md-admin-btn-outline:focus,
.mdb-btn-outline:focus,
.mdir-action-btn:focus,
.mdir-gallery-add-btn:focus {
    background-color: #eff6ff !important;
    color: #1e40af !important;
    border-color: #eff6ff !important;
}
.md-btn-outline:active,
.md-admin-btn-outline:active,
.mdb-btn-outline:active,
.mdir-action-btn:active,
.mdir-gallery-add-btn:active {
    background-color: #eff6ff !important;
    color: #1e40af !important;
    border-color: #eff6ff !important;
}
.md-btn-outline:disabled,
.md-admin-btn-outline:disabled,
.mdb-btn-outline:disabled,
.mdir-action-btn:disabled,
.mdir-gallery-add-btn:disabled,
.md-btn-outline[aria-disabled="true"],
.md-admin-btn-outline[aria-disabled="true"],
.mdb-btn-outline[aria-disabled="true"],
.mdir-action-btn[aria-disabled="true"],
.mdir-gallery-add-btn[aria-disabled="true"] {
    background-color: #e2e8f0 !important;
    color: #334155 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    opacity: 1 !important;
}

/* Outline buttons carry their own border so they read as buttons on white. */
.md-btn-outline,
.md-admin-btn-outline,
.mdb-btn-outline,
.mdir-action-btn,
.mdir-gallery-add-btn {
    border: 2px solid #1e40af !important;
}
.md-btn-outline:hover, .md-btn-outline:focus,
.md-admin-btn-outline:hover, .md-admin-btn-outline:focus,
.mdb-btn-outline:hover, .mdb-btn-outline:focus,
.mdir-action-btn:hover, .mdir-action-btn:focus,
.mdir-gallery-add-btn:hover, .mdir-gallery-add-btn:focus {
    border-color: #1e3a8a !important;
}

/* Any nested text must inherit, or a theme rule repaints the label alone. */
.md-btn, .md-btn-primary, .md-btn-outline, .mde-btn, .mdb-btn, .mda-cta-btn,
.md-search-btn, .mbo-tab, .mbo-geo-btn, .md-type-btn, .md-lt-btn,
.sp-cta-btn, .msa-cta-btn, .mbo-ad-btn, .md-backend-action {
    -webkit-text-fill-color: currentColor !important;
}
.md-btn span, .md-btn-primary span, .md-btn-outline span, .mde-btn span,
.mdb-btn span, .md-search-btn span, .mbo-tab span, .mbo-geo-btn span,
.md-type-btn span, .sp-cta-btn span, .msa-cta-btn span, .mbo-ad-btn span,
.md-backend-action span, .mdir-gallery-add-btn span,
.md-btn svg, .md-btn-primary svg, .mde-btn svg, .mdb-btn svg,
.md-search-btn svg, .mbo-tab svg, .md-backend-action svg {
    color: inherit !important;
    fill: currentColor;
    stroke: currentColor;
}

/* Focus ring on every button role. */
.md-btn:focus-visible, .md-btn-primary:focus-visible, .md-btn-outline:focus-visible,
.mde-btn:focus-visible, .mdb-btn:focus-visible, .md-search-btn:focus-visible,
.md-type-btn:focus-visible, .mda-cta-btn:focus-visible, .msa-cta-btn:focus-visible,
.sp-cta-btn:focus-visible, .mbo-ad-btn:focus-visible, .md-backend-action:focus-visible,
.mbo-filter-btn:focus-visible, .mdir-action-btn:focus-visible {
    outline: 3px solid #1e40af !important;
    outline-offset: 3px !important;
}

/* Generic fallback: a plugin button with a dark inline background but no
   declared text colour still gets a readable label. */
[class*="md-btn"]:not([class*="outline"]):not([class*="secondary"]),
[class*="mde-btn"]:not([class*="secondary"]),
[class*="mdb-btn"]:not([class*="outline"]) {
    text-shadow: none !important;
}

/* ==========================================================================
   v1.5.0 — ICONS, DISTANCE, AND REMAINING PAGE CONTRAST
   ========================================================================== */

/* Inline SVG icons follow the colour of whatever contains them. */
.mdir-icon {
    display: inline-block;
    vertical-align: -0.18em;
    flex-shrink: 0;
    color: inherit;
    stroke: currentColor;
    fill: none;
}
a .mdir-icon,
button .mdir-icon,
.mdb-service-badge .mdir-icon {
    color: inherit !important;
    stroke: currentColor !important;
}

/* Distance to base, shown under the serving line. */
.mdb-hero-distance {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0.25rem 0 0;
    font-size: 0.9375rem;
    font-weight: 600;
    color: #ffffff;              /* on the navy hero — 16.98:1 */
}
.mdb-hero-serving {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Service badges: #475569 on white is 7.58:1. */
.mdb-service-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: #475569 !important;
}

/* Category chip was pale blue on pale blue. #1E40AF on #DBEAFE = 7.31:1. */
.mdb-cat-chip,
.mdb-category-pill,
.mdb-hero-badge {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border: 1px solid #bfdbfe !important;
    font-weight: 600 !important;
}

/* Muted sidebar copy: #64748b (4.76:1) -> #475569 (7.58:1). */
.mdb-side-note,
.mdb-near-base p,
.mdb-side-card p.muted {
    color: #475569 !important;
}

/* "Get Listed" gold CTA: #1A1A1A on #F5B400 = 10.35:1. */
.mdb-side-cta-btn,
.mdb-get-listed {
    background-color: #f5b400 !important;
    color: #1a1a1a !important;
    border-color: #f5b400 !important;
}
.mdb-side-cta-btn:hover, .mdb-side-cta-btn:focus,
.mdb-get-listed:hover, .mdb-get-listed:focus {
    background-color: #ffc933 !important;
    color: #1a1a1a !important;
    border-color: #ffc933 !important;
}

/* ==========================================================================
   v1.6.0 — BASE GUIDE
   All pairs measured. Nothing below 7:1.
   ========================================================================== */

.bg-guide { margin: 2rem 0 2.5rem; }

.bg-guide-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f1d2f;                 /* 16.98:1 on white */
    margin: 0 0 1rem;
}

.bg-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}
.bg-stat {
    display: flex;
    flex-direction: column;
    background-color: #0f1d2f;
    color: #ffffff;                 /* 16.98:1 */
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    min-width: 8rem;
}
.bg-stat-num { font-size: 1.5rem; font-weight: 700; line-height: 1.1; color: #ffffff; }
.bg-stat-label { font-size: 0.8125rem; color: #e8ecf1; }  /* 14.31:1 on navy */

.bg-cols { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.bg-main { flex-basis: 62%; min-width: 20rem; }
.bg-side { flex-basis: 32%; min-width: 16rem; }
@media (max-width: 782px) {
    .bg-main, .bg-side { flex-basis: 100%; min-width: 0; }
}

.bg-card {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}
.bg-card-title {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #0f1d2f;
    margin: 0 0 0.5rem;
}
.bg-card-note { font-size: 0.875rem; color: #475569; margin: 0 0 1rem; }  /* 7.58:1 */
.bg-prose { color: #334155; line-height: 1.65; }                          /* 10.35:1 */
.bg-prose p { margin: 0 0 0.75rem; }

.bg-essentials { display: flex; flex-wrap: wrap; gap: 1rem; }
.bg-essential { flex-basis: 47%; min-width: 12rem; }
@media (max-width: 600px) { .bg-essential { flex-basis: 100%; } }

.bg-essential-head,
.bg-cat-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e40af;                 /* 8.72:1 */
    margin: 0 0 0.5rem;
}

.bg-essential ul,
.bg-cat-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.bg-essential li,
.bg-cat-list li {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.3rem 0;
    border-bottom: 1px solid #e8ecf1;
    font-size: 0.9375rem;
}

/* LVHA order is mandatory. */
.bg-essential a:link,    .bg-cat-list a:link,    .bg-nearby a:link    { color: #1e40af; text-decoration: none; }
.bg-essential a:visited, .bg-cat-list a:visited, .bg-nearby a:visited { color: #1e40af; }
.bg-essential a:hover,   .bg-cat-list a:hover,   .bg-nearby a:hover   { color: #1e3a8a; text-decoration: underline; }
.bg-essential a:active,  .bg-cat-list a:active,  .bg-nearby a:active  { color: #1e3a8a; }

.bg-dist,
.bg-nearby-meta {
    font-size: 0.8125rem;
    color: #475569;                 /* 7.58:1 */
    margin-left: auto;
    white-space: nowrap;
}
.bg-cat-phone {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8125rem;
    margin-left: auto;
}

.bg-facts { margin: 0; }
.bg-fact { display: flex; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid #e8ecf1; }
.bg-fact:last-child { border-bottom: 0; }
.bg-fact dt {
    display: flex; align-items: center; gap: 0.4rem;
    font-size: 0.8125rem; font-weight: 600; color: #475569;
    margin: 0;
}
.bg-fact dd { margin: 0; font-size: 0.9375rem; font-weight: 600; color: #0f1d2f; text-align: right; }
.bg-fact dd a:link    { color: #1e40af; }
.bg-fact dd a:visited { color: #1e40af; }
.bg-fact dd a:hover   { color: #1e3a8a; text-decoration: underline; }
.bg-fact dd a:active  { color: #1e3a8a; }

.bg-nearby { list-style: none; margin: 0; padding: 0; }
.bg-nearby li { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px solid #e8ecf1; font-size: 0.9375rem; }
.bg-nearby li:last-child { border-bottom: 0; }

/* Buttons: background AND text declared together in every state. */
.bg-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border: 2px solid transparent;
}
.bg-btn-block { width: 100%; justify-content: center; }

.bg-btn-primary,
.bg-btn-primary:link,
.bg-btn-primary:visited {
    background-color: #1e40af; color: #ffffff; border-color: #1e40af;   /* 8.72:1 */
}
.bg-btn-primary:hover,
.bg-btn-primary:focus,
.bg-btn-primary:active {
    background-color: #1e3a8a; color: #ffffff; border-color: #1e3a8a;   /* 10.36:1 */
    text-decoration: none;
}

.bg-btn-outline,
.bg-btn-outline:link,
.bg-btn-outline:visited {
    background-color: #ffffff; color: #1e40af; border-color: #1e40af;   /* 8.72:1 */
}
.bg-btn-outline:hover,
.bg-btn-outline:focus,
.bg-btn-outline:active {
    background-color: #eff6ff; color: #1e3a8a; border-color: #1e3a8a;   /* 9.55:1 */
    text-decoration: none;
}

.bg-btn:focus-visible {
    outline: 3px solid #1e40af;
    outline-offset: 3px;
}

.bg-card-empty { background-color: #f4f6f9; }
.bg-card-empty p { color: #334155; }

/* ==========================================================================
   v1.14.0 — SEARCH BAR

   This is a duty-station lookup, not a shopping filter: someone with orders
   works State -> Base -> Category -> Keyword, and each step narrows the next.
   So it reads as one continuous instrument with hairline dividers rather than
   four boxed inputs floating on a panel, and the one real dependency in the
   chain — base options are fetched from the chosen state — is marked with a
   chevron between those two cells rather than left implicit.

   Every pair measured; nothing below 7:1.
   ========================================================================== */

.mdsb-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1rem 0;
    box-sizing: border-box;
}

.mdsb {
    width: 100%;
    max-width: none;
    margin: 0;
    box-sizing: border-box;
    background-color: #0B1B2E;
    border-radius: 14px;
    padding: 1.5rem 1.6rem 1.6rem;
}
.mdsb-compact { padding: 1.15rem 1.25rem 1.25rem; }
.mdsb:only-child { margin: 0 auto; }

.mdsb-lede {
    margin: 0 0 0.9rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #7DD3FC;                      /* 10.18:1 on #0B1B2E */
}

/* --- the instrument ------------------------------------------------------ */
.mdsb-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0;
    background-color: #FFFFFF;
    border-radius: 12px;
    padding: 0.4rem;
    box-shadow: 0 1px 2px rgba(11, 27, 46, 0.28);
}
.mdsb-row:focus-within {
    box-shadow: 0 0 0 3px #7DD3FC, 0 1px 2px rgba(11, 27, 46, 0.28);
}

.mdsb-cell {
    position: relative;
    flex: 1 1 11rem;
    min-width: 9.5rem;
    padding: 0.5rem 0.9rem;
    box-sizing: border-box;
}
.mdsb-field-keyword { flex: 1.5 1 13rem; }

/* Hairline between cells, not around them. */
.mdsb-cell + .mdsb-cell::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55rem;
    bottom: 0.55rem;
    width: 1px;
    background-color: #D9E1EA;
}

/* The one genuine dependency in the chain. */
.mdsb-cell-base::after {
    content: "";
    position: absolute;
    left: -4px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 2px solid #94A3B8;
    border-bottom: 2px solid #94A3B8;
    transform: rotate(-45deg);
    background-color: #FFFFFF;
}

.mdsb-cell label {
    display: block;
    margin: 0 0 0.15rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.11em;
    text-transform: uppercase;
    color: #475569;                      /* 7.58:1 on white */
}

/* Controls borrow the bar's surface instead of carrying their own chrome. */
.mdsb-cell select,
.mdsb-cell input[type="search"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    border: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.5;
    color: #0F172A !important;           /* 17.85:1 on white */
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    outline: none;
}
.mdsb-cell select {
    padding-right: 1.1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%23475569' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 0 center !important;
    cursor: pointer;
}
.mdsb-cell select:disabled {
    color: #475569 !important;           /* 7.58:1 */
    cursor: wait;
}
.mdsb-cell input[type="search"]::placeholder {
    color: #475569;                      /* 7.58:1 — #64748B measured 4.76 */
    font-weight: 400;
    opacity: 1;
}

/* Focus lands on the cell, so the whole field reads as active. */
.mdsb-cell:focus-within { background-color: #F1F5F9; border-radius: 8px; }
.mdsb-cell:focus-within label { color: #1E40AF; }   /* 8.01:1 on #F1F5F9 */
.mdsb-cell select:focus-visible,
.mdsb-cell input:focus-visible { outline: none; }

/* --- action -------------------------------------------------------------- */
.mdsb-field-submit {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0.25rem;
}
.mdsb-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    height: 100%;
    min-height: 2.9rem;
    padding: 0 1.35rem;
    white-space: nowrap;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    border-radius: 9px;
    background-color: #1E40AF !important;
    color: #FFFFFF !important;           /* 8.72:1 */
    border: 0 !important;
    transition: none !important;
}
.mdsb-submit:hover,
.mdsb-submit:focus,
.mdsb-submit:active {
    background-color: #1E3A8A !important;
    color: #FFFFFF !important;           /* 10.36:1 */
}
.mdsb-submit:focus-visible {
    outline: 3px solid #7DD3FC !important;
    outline-offset: 3px !important;
}
.mdsb-submit .mdir-icon { color: inherit !important; stroke: currentColor !important; }

.mdsb-reset { margin: 0.9rem 0 0; }
.mdsb-reset a:link, .mdsb-reset a:visited {
    color: #CBD5E1;                      /* 11.0:1 on #0B1B2E */
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-decoration: underline;
}
.mdsb-reset a:hover, .mdsb-reset a:active { color: #FFFFFF; }
.mdsb-reset a:focus-visible { outline: 3px solid #7DD3FC; outline-offset: 3px; }

/* --- stacked ------------------------------------------------------------- */
@media (max-width: 860px) {
    .mdsb-row { flex-direction: column; padding: 0.25rem; }
    .mdsb-cell,
    .mdsb-field-keyword { flex: 1 1 auto; width: 100%; min-width: 0; }
    .mdsb-cell + .mdsb-cell::before {
        left: 0.9rem; right: 0.9rem; top: 0;
        width: auto; height: 1px; bottom: auto;
    }
    .mdsb-cell-base::after {
        left: 50%; top: -4px; margin-top: 0; margin-left: -4px;
        transform: rotate(45deg);
    }
    .mdsb-field-submit { padding: 0.4rem; }
    .mdsb-submit { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .mdsb-row, .mdsb-cell, .mdsb-submit { transition: none !important; }
}

/* ==========================================================================
   v1.8.0 — LOCATIONS MANAGER (STATES PANEL) + DASHBOARD ACTION ICONS
   ========================================================================== */

.md-states-panel {
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid #cbd5e1;
}
.md-states-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 700;
    color: #0f1d2f;                     /* 16.98:1 */
}
.md-states-note {
    margin: 0 0 0.85rem;
    font-size: 0.8125rem;
    color: #475569;                     /* 7.58:1 */
}

.md-states-add { display: flex; gap: 0.5rem; margin-bottom: 0.85rem; }
.md-states-add input[type="text"] {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0.55rem 0.7rem;
    font-size: 0.9375rem;
    font-family: inherit;
    background-color: #ffffff;
    color: #1a1a1a;                     /* 17.40:1 */
    border: 2px solid #cbd5e1;
    border-radius: 8px;
}
.md-states-add input[type="text"]:focus {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
    border-color: #1e40af;
}

.md-states-list { list-style: none; margin: 0; padding: 0; max-height: 22rem; overflow-y: auto; }
.md-states-list li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid #e8ecf1;
    font-size: 0.9375rem;
}
.md-states-name { color: #1e293b; font-weight: 600; }      /* 14.63:1 */
.md-states-count { margin-left: auto; font-size: 0.8125rem; color: #475569; }

.md-states-del:link,
.md-states-del:visited {
    color: #991b1b;                     /* 8.31:1 */
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
}
.md-states-del:hover,
.md-states-del:active {
    color: #7f1d1d;                     /* 10.02:1 */
    text-decoration: underline;
}
.md-states-del:focus-visible {
    outline: 3px solid #991b1b;
    outline-offset: 2px;
}

/* A state with bases attached cannot be deleted, and says so rather than
   offering an action that would fail. */
.md-states-locked {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #334155;                     /* 8.40:1 on #e2e8f0 */
    background-color: #e2e8f0;
    border-radius: 999px;
    padding: 0.15rem 0.55rem;
}

/* Dashboard action buttons: SVG icons inherit the button colour. */
.mdir-action-btn { display: inline-flex; align-items: center; justify-content: center; }
.mdir-action-btn svg { display: block; color: inherit; stroke: currentColor; fill: none; }
.mdir-action-btn span { display: inline-flex; color: inherit; }

.mdir-btn-view, .mdir-btn-edit, .mdir-btn-analytics {
    background-color: #ffffff !important;
    color: #1e40af !important;          /* 8.72:1 */
    border: 2px solid #1e40af !important;
}
.mdir-btn-view:hover, .mdir-btn-view:focus,
.mdir-btn-edit:hover, .mdir-btn-edit:focus,
.mdir-btn-analytics:hover, .mdir-btn-analytics:focus {
    background-color: #1e40af !important;
    color: #ffffff !important;          /* 8.72:1 */
    border-color: #1e40af !important;
}
.mdir-btn-delete {
    background-color: #991b1b !important;
    color: #ffffff !important;          /* 8.31:1 */
    border: 2px solid #991b1b !important;
}
.mdir-btn-delete:hover, .mdir-btn-delete:focus {
    background-color: #7f1d1d !important;
    color: #ffffff !important;          /* 10.02:1 */
    border-color: #7f1d1d !important;
}

/* --- SEO fields in the locations manager --------------------------------- */
.md-seo-fields {
    margin-top: 1.25rem;
    padding: 1rem 1.15rem;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background-color: #f4f6f9;
}
.md-seo-fields legend {
    padding: 0 0.4rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e40af;                     /* 8.01:1 on #f4f6f9 */
}
.md-seo-note { margin: 0 0 0.85rem; font-size: 0.8125rem; color: #334155; } /* 9.56:1 */
.md-seo-limit {
    float: right;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: #475569;                     /* 6.98:1 on #f4f6f9 — see below */
}
.md-seo-fields input[type="text"],
.md-seo-fields textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.7rem;
    font-family: inherit;
    font-size: 0.9375rem;
    background-color: #ffffff;
    color: #1a1a1a;                     /* 17.40:1 */
    border: 2px solid #cbd5e1;
    border-radius: 8px;
}
.md-seo-fields input[type="text"]:focus,
.md-seo-fields textarea:focus {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
    border-color: #1e40af;
}
.md-seo-fields ::placeholder { color: #475569; opacity: 1; }

/* ==========================================================================
   v1.9.0 — PROPERTY PAGE ACCESSIBILITY
   ========================================================================== */

/* Skip link: hidden until focused, then unmissable. */
.sp-skip {
    position: absolute;
    left: -9999px;
    top: 0;
    z-index: 10000;
}
.sp-skip:focus {
    left: 0.5rem;
    top: 0.5rem;
    width: auto;
    padding: 0.7rem 1.1rem;
    background-color: #0f1d2f;
    color: #ffffff;                     /* 16.98:1 */
    border-radius: 0 0 8px 0;
    font-weight: 700;
    text-decoration: none;
    outline: 3px solid #7dd3fc;
    outline-offset: 2px;
}
#sp-main:focus { outline: none; }

/* Section titles are headings now — keep the original visual weight. */
h2.sp-section-title {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #334155;                     /* 10.35:1 */
}
h2.sp-cta-title { margin: 0 0 0.35rem; font-size: 1.0625rem; font-weight: 700; }

/* A button that reads as a link still has to be reachable and visible. */
.sp-link-btn {
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: #1e40af;                     /* 8.72:1 */
    text-decoration: underline;
    cursor: pointer;
}
.sp-link-btn:hover, .sp-link-btn:focus { color: #1e3a8a; }
.sp-link-btn:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }

/* Thumbnails became buttons — strip the default chrome, keep the focus ring. */
button.sp-thumb {
    padding: 0;
    border: 2px solid transparent;
    background: none;
    cursor: pointer;
    line-height: 0;
}
button.sp-thumb.active { border-color: #1e40af; }
button.sp-thumb:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }

/* Calculator links */
.sp-calc-links { list-style: none; margin: 0; padding: 0; }
.sp-calc-links li { padding: 0.35rem 0; }
.sp-calc-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 600;
    font-size: 0.9375rem;
}
.sp-calc-links a:link,    .sp-calc-links a:visited { color: #1e40af; text-decoration: none; }
.sp-calc-links a:hover,   .sp-calc-links a:active  { color: #1e3a8a; text-decoration: underline; }
.sp-calc-links a:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }

/* "Opens in a new tab" must be announced, not just implied by an icon. */
.sp-ext { font-size: 0.75rem; font-weight: 500; color: #475569; }   /* 7.58:1 */
.sp-optional { font-weight: 400; color: #475569; }

/* Toolbar buttons: icon plus text, both inheriting one colour. */
.sp-tool-btn, .sp-tool-close {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.sp-tool-btn:focus-visible,
.sp-tool-close:focus-visible,
.sp-gal-nav:focus-visible,
.sp-modal-x:focus-visible,
.sp-ca-share:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 2px;
}

/* Form fields: visible focus and a real error affordance. */
.sp-field label { display: block; margin-bottom: 0.25rem; font-weight: 600; color: #1e293b; }
.sp-field input:focus, .sp-field textarea:focus {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
    border-color: #1e40af;
}
.sp-field input:invalid:not(:placeholder-shown),
.sp-field textarea:invalid:not(:placeholder-shown) {
    border-color: #991b1b;
}

@media (prefers-reduced-motion: reduce) {
    .sp-thumb, .sp-gal-nav, .sp-tool-btn, .sp-link-btn { transition: none !important; }
}

/* Footer headings on the base page kept their original visual size after
   being promoted to the correct level for document structure. */
h2.bp-foot-head { font-size: 0.9375rem; font-weight: 700; letter-spacing: 0.05em;
                  text-transform: uppercase; color: #1e293b; margin: 0 0 0.6rem; }
h3.bp-ad-head { font-size: 1rem; font-weight: 700; margin: 0 0 0.35rem; }

/* ==========================================================================
   v1.10.0 — BUSINESS SEARCH RESULTS & EMPTY STATE
   ========================================================================== */

.mdb-results-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem; }
.mdb-results-count { font-weight: 600; color: #1e293b; }   /* 14.63:1 */

.mdb-sort { display: flex; align-items: center; gap: 0.4rem; margin-left: auto; }
.mdb-sort label { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase;
                  letter-spacing: 0.04em; color: #475569; }   /* 7.58:1 */
.mdb-sort select {
    padding: 0.4rem 0.6rem;
    font-family: inherit;
    font-size: 0.875rem;
    background-color: #ffffff;
    color: #1a1a1a;                                          /* 17.40:1 */
    border: 2px solid #cbd5e1;
    border-radius: 8px;
}
.mdb-sort select:focus { outline: 3px solid #1e40af; outline-offset: 2px; border-color: #1e40af; }

/* Empty state carries the next click rather than being a dead end. */
.mdb-no-results {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 2rem 1.75rem;
    text-align: left;
}
.mdb-nr-title { margin: 0 0 0.4rem; font-size: 1.375rem; font-weight: 700; color: #0f1d2f; }
.mdb-nr-sub   { margin: 0 0 1.5rem; color: #475569; }        /* 7.58:1 */
.mdb-nr-block { margin-bottom: 1.35rem; }
.mdb-nr-block h3 {
    margin: 0 0 0.6rem;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e40af;                                          /* 8.72:1 */
}

.mdb-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.mdb-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    background-color: #ffffff;
    color: #1e40af;                                          /* 8.72:1 */
    border: 2px solid #1e40af;
}
.mdb-chip:link, .mdb-chip:visited { background-color: #ffffff; color: #1e40af; border-color: #1e40af; }
.mdb-chip:hover, .mdb-chip:active {
    background-color: #1e40af; color: #ffffff; border-color: #1e40af;   /* 8.72:1 */
    text-decoration: none;
}
.mdb-chip:focus-visible { outline: 3px solid #1e40af; outline-offset: 3px; }
.mdb-chip-n {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.05rem 0.4rem;
    border-radius: 999px;
    background-color: #e2e8f0;
    color: #334155;                                          /* 8.40:1 */
}
.mdb-chip:hover .mdb-chip-n, .mdb-chip:active .mdb-chip-n {
    background-color: #ffffff; color: #1e40af;
}

.mdb-btn-outline,
.mdb-btn-outline:link,
.mdb-btn-outline:visited {
    display: inline-block; padding: 0.6rem 1.1rem; border-radius: 8px; font-weight: 600;
    background-color: #ffffff; color: #1e40af; border: 2px solid #1e40af; text-decoration: none;
}
.mdb-btn-outline:hover, .mdb-btn-outline:active {
    background-color: #eff6ff; color: #1e3a8a; border-color: #1e3a8a;
}

/* Results bar sits directly under the search panel — give it room and a rule
   so the two read as separate regions. */
.mdb-results-bar {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.mdb-container { padding-top: 1.75rem; }

/* ==========================================================================
   v1.12.0 — BUSINESS PAGE SPACING
   The content grid started immediately under the hero band, and the hero's own
   lines were tight against its edges.
   ========================================================================== */

.mdb-hero {
    padding: 2.5rem 1.5rem 2.75rem !important;
}
.mdb-hero-crumbs { margin-bottom: 1rem !important; }
.mdb-hero-title  { margin: 0 0 0.5rem !important; }
.mdb-hero-serving,
.mdb-hero-distance { margin-top: 0.35rem !important; }

/* .md-py-6 is used on the business page's content wrapper but was never
   defined in any stylesheet, so the grid had no vertical padding at all and
   sat directly against the hero. Defining it fixes the cause rather than
   patching the symptom with an adjacent-sibling override. */
.md-py-6 { padding-top: 2.25rem; padding-bottom: 2.25rem; }

/* Category chip sat directly on the card below it. */
.mdb-cat-chip,
.mdb-category-pill {
    display: inline-block;
    margin-bottom: 1.25rem;
}

/* Sidebar cards were flush to each other and to the main column. */
.mdb-side-card,
.mdb-sidebar > div { margin-bottom: 1.5rem; }
.mdb-sidebar > div:last-child { margin-bottom: 0; }

/* Address card interior */
.mdb-addr-none { color: #475569; font-style: italic; }   /* 7.58:1 */

/* Contact buttons need space between them, not just a border. */
.mdb-contact-btn,
.mdb-contact-btn-primary { margin-bottom: 0.65rem; }
.mdb-contact-btn:last-child { margin-bottom: 0; }

@media (max-width: 782px) {
    .mdb-hero { padding: 1.75rem 1.15rem 2rem !important; }
    .md-py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
}

/* ==========================================================================
   v1.13.0 — AGENTS PAGE
   .mda-agents-page had no max-width and no padding, so every row ran to the
   viewport edges while the rest of the site sat in a 1200px container.
   ========================================================================== */

.mda-agents-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem 3rem;
    box-sizing: border-box;
}

/* The shortcode heading sat at h1 directly beneath the page's own h1. */
.mda-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    letter-spacing: -0.02em;
    color: #ffffff;                     /* 16.98:1 on the navy header */
}
.mda-header { padding: 2.5rem 1.5rem !important; margin-bottom: 0 !important; }

/* The search panel lives inside the page container here, so it needs no
   wrapper padding of its own. */
.mda-agents-page .mdsb-wrap {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-top: 1.5rem;
    max-width: none !important;
}

.mda-register-line { margin: 0.85rem 0 0; }
.mda-btn-add,
.mda-btn-add:link,
.mda-btn-add:visited {
    display: inline-block;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    background-color: #065f46;
    color: #ffffff;                     /* 7.68:1 */
    border: 2px solid #065f46;
}
.mda-btn-add:hover,
.mda-btn-add:active,
.mda-btn-add:focus {
    background-color: #064e3b;
    color: #ffffff;                     /* 9.72:1 */
    border-color: #064e3b;
    text-decoration: none;
}
.mda-btn-add:focus-visible { outline: 3px solid #ffffff; outline-offset: 3px; }

.mda-results-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 0 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.mda-results-count { font-weight: 600; color: #1e293b; }   /* 14.63:1 */

.mda-no-results,
.mda-empty {
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 2.5rem 1.75rem;
    text-align: center;
}
.mda-no-results h3 { margin: 0 0 0.5rem; font-size: 1.375rem; color: #0f1d2f; }
.mda-no-results p  { margin: 0; color: #475569; }          /* 7.58:1 */
.mda-no-results a:link, .mda-no-results a:visited { color: #1e40af; }
.mda-no-results a:hover, .mda-no-results a:active { color: #1e3a8a; }

@media (max-width: 600px) {
    .mda-agents-page { padding: 1.25rem 1rem 2rem; }
    .mda-header { padding: 1.75rem 1.15rem !important; }
    .mda-header h2 { font-size: 1.5rem; }
}

/* ==========================================================================
   v1.15.0 — DIRECTORY SIDEBAR
   Content first in the source order, so the sidebar falls below the results on
   narrow screens and never pushes the listings off the first screen.
   ========================================================================== */

.mdb-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: flex-start;
}
.mdb-main { flex: 1 1 30rem; min-width: 0; }

.mds {
    flex: 0 0 17rem;
    max-width: 17rem;
    position: sticky;
    top: 1.5rem;
    box-sizing: border-box;
}
@media (max-width: 1000px) {
    .mds { flex: 1 1 100%; max-width: none; position: static; }
}

.mds-block {
    background-color: #ffffff;
    border: 1px solid #d9e1ea;
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
    margin-bottom: 1rem;
}
.mds-block:last-child { margin-bottom: 0; }

.mds-head {
    margin: 0 0 0.65rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #475569;                      /* 7.58:1 */
}

.mds-list { list-style: none; margin: 0; padding: 0; }
.mds-list li + li { border-top: 1px solid #eef2f6; }

.mds-link {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.15rem;
    font-size: 0.9375rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 6px;
}
.mds-link:link,
.mds-link:visited { color: #1e293b; }    /* 14.63:1 */
.mds-link:hover,
.mds-link:active  { color: #1e40af; text-decoration: underline; }
.mds-link:focus-visible {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
    text-decoration: none;
}

/* Current page: marked by weight and a rule, not colour alone. */
.mds-link.is-current,
.mds-link.is-current:link,
.mds-link.is-current:visited {
    color: #1e40af;                      /* 8.72:1 */
    font-weight: 700;
    box-shadow: inset 3px 0 0 #1e40af;
    padding-left: 0.6rem;
    text-decoration: none;
}

.mds-label { flex: 1 1 auto; min-width: 0; }

.mds-count {
    flex: 0 0 auto;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background-color: #eef2f6;
    color: #334155;                      /* 9.85:1 on #eef2f6 */
}
.mds-link:hover .mds-count { background-color: #dbeafe; color: #1e40af; }

.mds-link .mdir-icon { color: inherit; stroke: currentColor; flex-shrink: 0; }

@media (prefers-reduced-motion: reduce) {
    .mds-link { transition: none !important; }
}

/* ==========================================================================
   v1.16.0 — PAGE WIDTH

   Container widths had drifted across two stylesheets and five templates:
   1200px, 72rem (1152px), 1100px and 1000px, depending on which page you
   landed on. One token now drives all of them, so they widen together and
   cannot fall out of step again.
   ========================================================================== */

:root {
    --mdir-max: 1400px;
    --mdir-gutter: 1.25rem;
}

.md-max-w-6xl,
.mdb-container,
.mdsb-wrap,
.mda-agents-page,
.sp-wrap,
.mbo-main,
.bp-main,
.bp-bottom,
.mdb-search-form {
    max-width: var(--mdir-max) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    box-sizing: border-box;
}

/* Wider page means the sidebar can carry more without squeezing the grid. */
.mds {
    flex: 0 0 19rem;
    max-width: 19rem;
}
@media (max-width: 1000px) {
    .mds { flex: 1 1 100%; max-width: none; }
}

/* The card grid gets the recovered space rather than stretching three columns
   across it. */
.mdb-grid {
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)) !important;
    gap: 1.5rem !important;
}

/* Consistent gutters so nothing touches the viewport edge at any width. */
.mdb-container,
.mda-agents-page {
    padding-left: var(--mdir-gutter) !important;
    padding-right: var(--mdir-gutter) !important;
}
.mdsb-wrap {
    padding-left: var(--mdir-gutter) !important;
    padding-right: var(--mdir-gutter) !important;
}

@media (max-width: 600px) {
    :root { --mdir-gutter: 1rem; }
}

/* ==========================================================================
   v1.17.0 — BASE PAGE ORGANISATION
   ========================================================================== */

/* The per-page select had no width constraint, so it rendered as a full-width
   bar beneath the results. It is a small control and should look like one. */
.bp-pagination {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}
.bp-pagination label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;                      /* 7.58:1 */
}
.bp-pagination select {
    width: auto !important;
    min-width: 4.5rem;
    padding: 0.4rem 0.6rem;
    font-family: inherit;
    font-size: 0.875rem;
    background-color: #ffffff;
    color: #1a1a1a;                      /* 17.40:1 */
    border: 2px solid #cbd5e1;
    border-radius: 8px;
}
.bp-pagination select:focus {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
    border-color: #1e40af;
}

/* The guide now sits between the results and the footer links, so it needs to
   read as its own region rather than running into them. */
.bg-guide {
    margin-top: 2.5rem;
    padding-top: 2.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Footer links: one column of real destinations rather than two, one of which
   was five dead "#" links duplicated from the sidebar. */
.bp-bottom { padding: 2rem 1.5rem !important; }
.bp-bottom a:link, .bp-bottom a:visited { color: #1e40af; }   /* 8.72:1 */
.bp-bottom a:hover, .bp-bottom a:active { color: #1e3a8a; text-decoration: underline; }

.bp-side-link { display: block; padding: 0.45rem 0; }
.bp-side-body .bp-side-link + .bp-side-link { border-top: 1px solid #eef2f6; }

/* ==========================================================================
   v1.18.0 — HOUSE PROMO SLOTS
   Replaces hardcoded competitor ad creative. Styled as site promotions, not
   as banner ads, so they read as part of the product.
   ========================================================================== */

.bp-ads {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    justify-content: center;
    padding: 2.5rem 1.5rem !important;
}

.mdp {
    flex: 1 1 22rem;
    max-width: 30rem;
    box-sizing: border-box;
    background-color: #ffffff;
    border: 1px solid #d9e1ea;
    border-radius: 12px;
    padding: 1.5rem 1.6rem;
}
.mdp-icon { color: #1e40af; margin-bottom: 0.5rem; }
.mdp-eyebrow {
    margin: 0 0 0.3rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: #475569;                      /* 7.58:1 */
}
.mdp-title {
    margin: 0 0 0.5rem;
    font-size: 1.1875rem;
    font-weight: 700;
    color: #0f1d2f;                      /* 16.98:1 */
}
.mdp-body { margin: 0 0 1rem; font-size: 0.9375rem; line-height: 1.6; color: #334155; }
.mdp-note { margin: 0.6rem 0 0; font-size: 0.75rem; color: #475569; }

.mdp-cta,
.mdp-cta:link,
.mdp-cta:visited {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    background-color: #1e40af;
    color: #ffffff;                      /* 8.72:1 */
    border: 2px solid #1e40af;
}
.mdp-cta:hover,
.mdp-cta:active,
.mdp-cta:focus {
    background-color: #1e3a8a;
    color: #ffffff;                      /* 10.36:1 */
    border-color: #1e3a8a;
    text-decoration: none;
}
.mdp-cta:focus-visible { outline: 3px solid #1e40af; outline-offset: 3px; }
.mdp-cta .mdir-icon { color: inherit; stroke: currentColor; }

.bp-about { max-width: 1400px; margin: 0 auto; padding: 2rem 1.25rem; }
.bp-about p { color: #334155; line-height: 1.7; margin: 0 0 0.75rem; }  /* 10.35:1 */
.bp-about a:link, .bp-about a:visited { color: #1e40af; }
.bp-about a:hover, .bp-about a:active { color: #1e3a8a; text-decoration: underline; }

/* Business hours rows on the submit form. */
.hours-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eef2f6;
}
.hours-day { flex: 0 0 6rem; font-weight: 600; color: #1e293b; }   /* 14.63:1 */
.hours-sep { color: #475569; }
.hours-row input[type="time"] {
    padding: 0.4rem 0.55rem;
    font-family: inherit;
    background-color: #ffffff;
    color: #1a1a1a;                                                 /* 17.40:1 */
    border: 2px solid #cbd5e1;
    border-radius: 8px;
}
.hours-row input[type="time"]:focus {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
    border-color: #1e40af;
}
.hours-closed {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    font-size: 0.875rem;
    color: #475569;                                                 /* 7.58:1 */
    cursor: pointer;
}
.hours-closed input:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }
@media (max-width: 600px) {
    .hours-day { flex: 1 1 100%; }
}

/* ==========================================================================
   v1.21.0 — TYPE SIZE, BREADCRUMBS, GUIDE PAGE

   Body copy across the directory sat between 0.8125rem and 0.9375rem (13-15px).
   WCAG sets no minimum, but 13px body text fails real users on real screens,
   and this audience reads it on a phone in a hotel. Base copy is now 1rem with
   supporting text no smaller than 0.875rem.
   ========================================================================== */

.bg-guide,
.mds,
.mdb-container,
.bp-main,
.sp-wrap {
    font-size: 1rem;
    line-height: 1.6;
}

.bg-prose,
.bg-card p,
.mds-link,
.mdb-card p,
.sp-section-body,
.bp-about p            { font-size: 1rem; }

.bg-essential li,
.bg-cat-list li,
.bg-nearby li,
.bg-fact dd            { font-size: 1rem; }

.bg-card-note,
.bg-dist,
.bg-nearby-meta,
.mds-count,
.sp-stat-label,
.mdb-service-badge     { font-size: 0.875rem; }

.bg-card-title         { font-size: 1.1875rem; }
.bg-guide-title        { font-size: 1.75rem; }
.bg-fact dt            { font-size: 0.875rem; }
.bg-essential-head,
.bg-cat-head,
.mds-head              { font-size: 0.8125rem; }
.bg-stat-num           { font-size: 1.75rem; }
.bg-stat-label         { font-size: 0.875rem; }

/* --- breadcrumbs --------------------------------------------------------- */
.mdbc { padding: 0.9rem 0; }
.mdbc-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
}
.mdbc-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.mdbc-link:link, .mdbc-link:visited { color: #1e40af; text-decoration: none; }   /* 8.72:1 */
.mdbc-link:hover, .mdbc-link:active { color: #1e3a8a; text-decoration: underline; }
.mdbc-link:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }
.mdbc-current { color: #334155; font-weight: 600; }                              /* 10.35:1 */
.mdbc-sep { color: #94a3b8; display: inline-flex; }

/* On the dark hero the trail has to invert. */
.bp-hero .mdbc-link:link, .bp-hero .mdbc-link:visited,
.mdb-hero .mdbc-link:link, .mdb-hero .mdbc-link:visited { color: #bfdbfe; }       /* 9.9:1 on navy */
.bp-hero .mdbc-link:hover, .mdb-hero .mdbc-link:hover   { color: #ffffff; }
.bp-hero .mdbc-current, .mdb-hero .mdbc-current         { color: #ffffff; }
.bp-hero .mdbc-sep, .mdb-hero .mdbc-sep                 { color: #7f9ec4; }

.sp-crumbs { padding-top: 0.5rem; }

/* --- link across to the guide -------------------------------------------- */
.bp-guide-link { background-color: #f4f6f9; border-top: 1px solid #d9e1ea; border-bottom: 1px solid #d9e1ea; }
.bp-guide-link-inner {
    max-width: var(--mdir-max);
    margin: 0 auto;
    padding: 1.75rem var(--mdir-gutter);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}
.bp-guide-link h2 { margin: 0 0 0.25rem; font-size: 1.375rem; color: #0f1d2f; }   /* 16.98:1 */
.bp-guide-link p  { margin: 0; font-size: 1rem; color: #334155; }                 /* 10.35:1 */
.bp-guide-btn,
.bp-guide-btn:link,
.bp-guide-btn:visited {
    display: inline-flex; align-items: center; gap: 0.45rem;
    padding: 0.75rem 1.25rem; border-radius: 8px;
    font-size: 1rem; font-weight: 600; text-decoration: none;
    background-color: #1e40af; color: #ffffff; border: 2px solid #1e40af;          /* 8.72:1 */
}
.bp-guide-btn:hover, .bp-guide-btn:active, .bp-guide-btn:focus {
    background-color: #1e3a8a; color: #ffffff; border-color: #1e3a8a;              /* 10.36:1 */
}
.bp-guide-btn:focus-visible { outline: 3px solid #1e40af; outline-offset: 3px; }

/* --- the guide's own page ------------------------------------------------ */
.bg-page-inner { max-width: var(--mdir-max); margin: 0 auto; padding: 0 var(--mdir-gutter); }
.bg-page-hero { background-color: #0f1d2f; padding: 2.25rem 0 2.5rem; margin-bottom: 0.5rem; }
.bg-page-eyebrow {
    margin: 0 0 0.35rem; font-size: 0.8125rem; font-weight: 700;
    letter-spacing: 0.12em; text-transform: uppercase; color: #7dd3fc;             /* 10.18:1 */
}
.bg-page-title { margin: 0 0 1rem; font-size: 2.25rem; font-weight: 700; color: #ffffff; }
.bg-page-back,
.bg-page-back:link,
.bg-page-back:visited {
    display: inline-flex; align-items: center; gap: 0.5rem;
    font-size: 1rem; font-weight: 600; text-decoration: none;
    color: #e8ecf1;                                                                /* 14.31:1 */
    border-bottom: 2px solid rgba(232,236,241,0.35);
    padding-bottom: 0.15rem;
}
.bg-page-back:hover, .bg-page-back:active { color: #ffffff; border-bottom-color: #ffffff; }
.bg-page-back:focus-visible { outline: 3px solid #7dd3fc; outline-offset: 3px; }
.bg-page .bg-guide { border-top: 0; padding-top: 1.5rem; }

@media (max-width: 600px) {
    .bg-page-title { font-size: 1.625rem; }
    .bp-guide-link-inner { flex-direction: column; align-items: flex-start; }
}

/* ==========================================================================
   v1.22.0 — MOBILE FILTER BAR

   Three faults compounded on a phone:
     1. .bp-filter used align-items:stretch, so once the filter buttons wrapped
        onto three rows the search box stretched to match their combined height
        — the tall empty white box.
     2. .bp-add carried margin-left:auto, which on a wrapped row pushed it past
        the right edge instead of onto its own line.
     3. .bp-filter-search input was a fixed 180px that could not shrink.
   ========================================================================== */

/* Fixed at every width, not just on phones: a search field should never take
   its height from a neighbouring control. */
.bp-filter { align-items: center !important; }
.bp-filter-search { align-self: center; }
.bp-fbtn { height: auto !important; }

@media (max-width: 900px) {
    .bp-filter {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.5rem;
        padding: 0.6rem !important;
    }

    .bp-filter-search {
        margin: 0 !important;
        width: 100%;
    }
    .bp-filter-search input {
        width: 100% !important;
        min-width: 0;
        flex: 1 1 auto;
        /* iOS zooms the viewport when a focused field is under 16px. */
        font-size: 1rem !important;
        padding: 0.8rem 0.9rem !important;
    }
    .bp-filter-search button {
        flex: 0 0 auto;
        min-width: 3rem;
        padding: 0.8rem 1rem !important;
    }

    /* Two even columns beat a ragged wrap. */
    .bp-filters {
        width: 100%;
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
        align-items: stretch;
    }
    .bp-fdrop { width: 100%; min-width: 0; }

    .bp-fbtn {
        width: 100%;
        min-height: 44px;          /* WCAG 2.5.8 target size */
        justify-content: space-between;
        padding: 0.75rem 0.85rem !important;
        font-size: 0.75rem !important;
        background: rgba(255,255,255,0.08) !important;
        color: #ffffff !important;  /* 16.98:1 on the navy bar */
        border-radius: 8px;
    }
    .bp-fbtn.active {
        /* 0.18 alpha lifted the surface enough to drop the pair to 6.67:1. */
        background: rgba(125,211,252,0.10) !important;
        color: #7dd3fc !important;  /* 8.36:1 on the resulting surface */
        box-shadow: inset 0 0 0 1px rgba(125,211,252,0.55);
    }

    /* An absolutely positioned menu inside a grid cell escapes its column, so
       on mobile the panel flows inline instead. */
    .bp-fmenu {
        position: static !important;
        width: 100% !important;
        min-width: 0 !important;
        margin-top: 0.35rem;
        border-radius: 8px;
    }
    .bp-fmenu.show { display: block; }

    /* Clear All and Add Listing each get their own full-width row. */
    .bp-filters > a[href*="clear"],
    .bp-filter .bp-clear {
        grid-column: 1 / -1;
        text-align: center;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .bp-add {
        margin-left: 0 !important;
        width: 100%;
        justify-content: center;
        min-height: 44px;
        padding: 0.85rem 1rem !important;
        font-size: 0.8125rem !important;
        border-radius: 8px;
    }

    /* Sort row */
    .bp-sort {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.9rem var(--mdir-gutter) !important;
    }
    .bp-sort select {
        max-width: none !important;
        min-height: 44px;
        font-size: 1rem !important;
        flex: 1 1 45%;
    }
    .bp-save { width: 100%; }
    .bp-save input { font-size: 1rem !important; min-height: 44px; }
    .bp-save button { min-height: 44px; }

    /* Header block */
    .bp-header, .bp-crumb, .mdbc { padding-left: var(--mdir-gutter); padding-right: var(--mdir-gutter); }
    .bp-name { font-size: 1.5rem !important; }
    .bp-subtitle { font-size: 0.8125rem !important; }
}

/* Any remaining text input on a phone gets the same anti-zoom treatment. */
@media (max-width: 900px) {
    .mdsb-cell input[type="search"],
    .mdsb-cell select,
    .mdb-container input[type="search"],
    .bp-filter input,
    .sp-field input,
    .sp-field textarea { font-size: 1rem !important; }

    .mdsb-submit, .mdb-chip, .mds-link, .bg-btn, .mdp-cta { min-height: 44px; }
    .mds-link { padding-top: 0.65rem; padding-bottom: 0.65rem; }
}

/* ==========================================================================
   v1.23.0 — SITE-WIDE MOBILE PASS
   ========================================================================== */

/* Visually-hidden labels: present for assistive tech, invisible on screen.
   Defined once here because several templates relied on the theme providing it. */
.screen-reader-text {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
.screen-reader-text:focus {
    position: static !important;
    width: auto; height: auto;
    margin: 0; clip: auto;
    white-space: normal;
}

/* Data tables overflow a phone. Let them scroll rather than break the layout,
   and announce that they scroll. */
.mdir-table-scroll,
.md-backend-table-wrap,
.mdir-dash-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
@media (max-width: 782px) {
    .md-backend-table,
    .mdir-dash-table,
    .mdir-listings-table,
    .md-dash-table { min-width: 34rem; }
}

/* Anything the site renders inside a container must not exceed it. */
.mdb-container img,
.bg-page img,
.sp-wrap img,
.bp-main img,
.mda-agents-page img { max-width: 100%; height: auto; }

@media (max-width: 782px) {
    /* Every text control at 16px so iOS stops zooming on focus. */
    input[type="text"], input[type="search"], input[type="email"],
    input[type="tel"], input[type="url"], input[type="number"],
    input[type="password"], input[type="time"], input[type="date"],
    select, textarea {
        font-size: 1rem !important;
    }

    /* Touch targets. */
    .md-btn, .mdb-btn, .mde-btn, .bg-btn, .mdp-cta, .mdsb-submit,
    .mds-link, .mdb-chip, .bp-fbtn, .bp-add, .mda-btn-add,
    .mdir-action-btn, .sp-tool-btn, .sp-ca-share {
        min-height: 44px;
    }

    /* Two-column layouts collapse. */
    .bg-cols, .mdb-layout, .bp-main, .mds { display: block; }
    .bg-main, .bg-side, .mdb-main, .mds { width: 100%; max-width: none; }
    .mds { margin-top: 1.5rem; }

    .bg-essentials { display: block; }
    .bg-essential { width: 100%; margin-bottom: 1.25rem; }

    .bg-stats { gap: 0.5rem; }
    .bg-stat { flex: 1 1 45%; min-width: 0; padding: 0.65rem 0.85rem; }
    .bg-stat-num { font-size: 1.375rem; }

    .bg-page-hero { padding: 1.5rem 0 1.75rem; }
    .bg-guide-title { font-size: 1.375rem; }

    /* Long values (URLs, emails) must wrap rather than force a sideways scroll. */
    .bg-fact dd, .mdb-card p, .sp-section-body, .mds-label {
        overflow-wrap: anywhere;
        word-break: break-word;
    }
    .bg-fact { flex-wrap: wrap; }
    .bg-fact dd { text-align: left; width: 100%; }
}

/* Nothing should be able to scroll the whole page sideways. */
.bg-page, .mdb-container, .mda-agents-page, .bp-main, .sp-wrap { max-width: 100%; }

/* ==========================================================================
   v1.24.0 — LEGAL DOCUMENTS
   Long-form reading: a measure near 70 characters, generous leading, and
   headings that are scannable without a table of contents.
   ========================================================================== */

.mdl {
    max-width: 46rem;
    margin: 0 auto;
    padding: 2.5rem var(--mdir-gutter) 4rem;
    font-size: 1.0625rem;
    line-height: 1.7;
    color: #1e293b;                       /* 14.63:1 */
}
.mdl-head { margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 2px solid #d9e1ea; }
.mdl-title { margin: 0 0 0.35rem; font-size: 2rem; font-weight: 700; color: #0f1d2f; }
.mdl-updated { margin: 0; font-size: 0.9375rem; color: #475569; }   /* 7.58:1 */

.mdl-body h2 {
    margin: 2.25rem 0 0.75rem;
    font-size: 1.3125rem;
    font-weight: 700;
    color: #0f1d2f;                       /* 16.98:1 */
    padding-top: 0.5rem;
    border-top: 1px solid #eef2f6;
}
.mdl-body h3 { margin: 1.5rem 0 0.5rem; font-size: 1.0625rem; font-weight: 700; color: #1e293b; }
.mdl-body p  { margin: 0 0 1rem; }
.mdl-body ul, .mdl-body ol { margin: 0 0 1.25rem; padding-left: 1.35rem; }
.mdl-body li { margin-bottom: 0.4rem; }
.mdl-body strong { color: #0f1d2f; }
.mdl-body hr { border: 0; border-top: 1px solid #d9e1ea; margin: 2rem 0; }

.mdl-body a:link, .mdl-body a:visited { color: #1e40af; }            /* 8.72:1 */
.mdl-body a:hover, .mdl-body a:active { color: #1e3a8a; text-decoration: underline; }
.mdl-body a:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }

.mdl-table-scroll { width: 100%; overflow-x: auto; margin: 0 0 1.5rem; }
.mdl-body table { border-collapse: collapse; width: 100%; min-width: 26rem; font-size: 1rem; }
.mdl-body th, .mdl-body td {
    text-align: left; padding: 0.6rem 0.75rem; border-bottom: 1px solid #e2e8f0; vertical-align: top;
}
.mdl-body th { background-color: #f4f6f9; font-weight: 700; color: #0f1d2f; }

/* Shown to administrators only, so an unfinished document is obvious to the
   operator without alarming a visitor. */
.mdl-admin-warning {
    background-color: #fef3c7;
    border-left: 4px solid #b45309;
    color: #422006;                       /* 12.4:1 on #fef3c7 */
    padding: 0.9rem 1.1rem;
    margin-bottom: 1.75rem;
    border-radius: 0 8px 8px 0;
    font-size: 0.9375rem;
}

.mdl-foot { margin-top: 3rem; padding-top: 1.25rem; border-top: 2px solid #d9e1ea; }
.mdl-related { display: flex; flex-wrap: wrap; gap: 1.25rem; list-style: none; margin: 0; padding: 0; }
.mdl-related a:link, .mdl-related a:visited { color: #1e40af; font-weight: 600; }
.mdl-related a:hover { color: #1e3a8a; text-decoration: underline; }

@media (max-width: 600px) {
    .mdl { padding-top: 1.5rem; font-size: 1rem; }
    .mdl-title { font-size: 1.5rem; }
    .mdl-body h2 { font-size: 1.1875rem; }
}

/* ==========================================================================
   v1.25.0 — PROPERTY CARD

   .bp-card-overlay is a sibling of .bp-card-img, not a child, and .bp-card had
   no positioning context — so the absolutely positioned overlay escaped to the
   nearest positioned ancestor and rendered detached from its card. .bp-card is
   now the containing block.
   ========================================================================== */

.bp-card { position: relative; }
.bp-card-overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 3rem 0.9rem 0.9rem;
    background: linear-gradient(transparent, rgba(0,0,0,0.55) 35%, rgba(0,0,0,0.88));
    color: #ffffff;
    z-index: 1;
    pointer-events: none;
}

/* Card text was 10-11px. Legible sizes, and the address gets two lines rather
   than being clipped mid-word. */
.bp-card-price  { font-size: 1.125rem !important; line-height: 1.2; margin: 0 0 0.15rem !important; }
.bp-card-specs  { font-size: 0.875rem !important; color: #e8ecf1 !important; margin: 0 0 0.25rem !important; }
.bp-card-addr {
    font-size: 0.8125rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    opacity: 1 !important;
    color: #e8ecf1 !important;
    margin: 0 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bp-card-img { aspect-ratio: 4 / 3; }
.bp-card-badges { z-index: 2; }
.bp-card-star   { z-index: 3; pointer-events: auto; }

@media (max-width: 600px) {
    .bp-card-overlay { padding: 2.5rem 0.75rem 0.75rem; }
    .bp-card-price { font-size: 1.0625rem !important; }
}

/* Sub-headings inside the guide's about card. */
.bg-sub {
    margin: 1.5rem 0 0.5rem;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;                      /* 7.58:1 */
}

/* ==========================================================================
   v1.28.0 — BASE HUB

   /homes-near/{base}/ is the installation's own page. Listings moved to
   /homes/, /services/ and /agents/ so the base URL has something to be.
   ========================================================================== */

.bh-inner { max-width: var(--mdir-max); margin: 0 auto; padding: 0 var(--mdir-gutter); }

.bh-hero { background-color: #0f1d2f; padding: 2.5rem 0 2.75rem; margin-bottom: 2rem; }
.bh-eyebrow {
    margin: 0 0 0.4rem;
    font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em;
    text-transform: uppercase; color: #7dd3fc;              /* 10.18:1 */
}
.bh-title { margin: 0 0 0.6rem; font-size: 2.375rem; font-weight: 700; color: #ffffff; }
.bh-lede  { margin: 0; max-width: 46rem; font-size: 1.0625rem; line-height: 1.6; color: #e8ecf1; }  /* 14.31:1 */

.bh-h2 {
    display: flex; align-items: center; gap: 0.6rem;
    margin: 0 0 1.1rem; font-size: 1.5rem; font-weight: 700; color: #0f1d2f;
}
.bh-count {
    font-size: 0.8125rem; font-weight: 700;
    background-color: #eef2f6; color: #334155;              /* 9.85:1 */
    border-radius: 999px; padding: 0.1rem 0.6rem;
}

/* --- route cards --------------------------------------------------------- */
.bh-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 1.1rem;
    list-style: none; margin: 0 0 3rem; padding: 0;
}
.bh-card-link {
    display: flex; flex-direction: column; gap: 0.35rem; height: 100%;
    box-sizing: border-box;
    padding: 1.4rem 1.5rem;
    background-color: #ffffff;
    border: 1px solid #d9e1ea;
    border-radius: 12px;
    text-decoration: none;
}
a.bh-card-link:hover, a.bh-card-link:focus {
    border-color: #1e40af;
    box-shadow: 0 2px 10px rgba(15,29,47,0.08);
    text-decoration: none;
}
a.bh-card-link:focus-visible { outline: 3px solid #1e40af; outline-offset: 3px; }

.bh-card-icon  { color: #1e40af; }                          /* 8.72:1 */
.bh-card-count { font-size: 1.75rem; font-weight: 700; line-height: 1.1; color: #0f1d2f; }
.bh-card .bh-card-title { font-size: 1.0625rem; font-weight: 700; color: #0f1d2f; }
.bh-card-blurb { font-size: 0.9375rem; line-height: 1.5; color: #475569; }   /* 7.58:1 */
.bh-card-go {
    display: inline-flex; align-items: center; gap: 0.35rem;
    margin-top: auto; padding-top: 0.75rem;
    font-size: 0.9375rem; font-weight: 700; color: #1e40af;
}

/* An empty section offers the first entry rather than showing a dead card. */
.bh-card.is-empty .bh-card-link { background-color: #f4f6f9; }
.bh-card.is-empty .bh-card-blurb { color: #334155; }   /* 9.56:1 on the tint */
.bh-card-cta,
.bh-card-cta:link, .bh-card-cta:visited {
    display: inline-flex; align-items: center; gap: 0.35rem;
    margin-top: auto; padding-top: 0.75rem;
    font-size: 0.9375rem; font-weight: 700; color: #1e40af; text-decoration: none;
}
.bh-card-cta:hover, .bh-card-cta:active { color: #1e3a8a; text-decoration: underline; }

/* --- sub-page lists ------------------------------------------------------ */
.bh-catblock { margin-bottom: 2.25rem; }
.bh-list { list-style: none; margin: 0; padding: 0; }
.bh-list li {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 0.9rem;
    padding: 0.75rem 0; border-bottom: 1px solid #eef2f6;
}
.bh-list-title:link, .bh-list-title:visited { color: #1e40af; font-weight: 600; font-size: 1rem; text-decoration: none; }
.bh-list-title:hover, .bh-list-title:active { color: #1e3a8a; text-decoration: underline; }
.bh-list-addr  { font-size: 0.9375rem; color: #475569; }    /* 7.58:1 */
.bh-list-phone { display: inline-flex; align-items: center; gap: 0.3rem; font-size: 0.9375rem; }
.bh-list-dist  { margin-left: auto; font-size: 0.875rem; color: #475569; white-space: nowrap; }

.bh-empty {
    background-color: #f4f6f9; border: 1px solid #d9e1ea; border-radius: 12px;
    padding: 2.5rem 1.75rem; text-align: center;
}
.bh-empty h2 { margin: 0 0 0.5rem; font-size: 1.375rem; color: #0f1d2f; }
.bh-empty p  { margin: 0 0 1.25rem; color: #334155; }       /* 9.56:1 */

.bh-btn, .bh-btn:link, .bh-btn:visited {
    display: inline-flex; align-items: center; gap: 0.4rem;
    padding: 0.75rem 1.25rem; border-radius: 8px; font-weight: 600; text-decoration: none;
    background-color: #1e40af; color: #ffffff; border: 2px solid #1e40af;   /* 8.72:1 */
}
.bh-btn:hover, .bh-btn:active { background-color: #1e3a8a; border-color: #1e3a8a; color: #ffffff; }

.bh-back { margin: 2.5rem 0 3rem; }
.bh-back-inline { padding: 0 var(--mdir-gutter); }
.bh-back a:link, .bh-back a:visited {
    display: inline-flex; align-items: center; gap: 0.4rem;
    font-weight: 600; color: #1e40af; text-decoration: none;
}
.bh-back a:hover, .bh-back a:active { color: #1e3a8a; text-decoration: underline; }

.bh .bg-guide { border-top: 1px solid #e2e8f0; }

@media (max-width: 600px) {
    .bh-hero { padding: 1.75rem 0 2rem; }
    .bh-title { font-size: 1.75rem; }
    .bh-cards { gap: 0.85rem; margin-bottom: 2rem; }
    .bh-list-dist { margin-left: 0; }
}

/* ==========================================================================
   v1.30.0 — LINKS OUT FROM THE LISTINGS PAGE

   The base URL is the listings page again. These cards sit beneath the
   results and route to the installation's other pages, which live at parallel
   top-level paths rather than nested under the base.
   ========================================================================== */

.bp-links { background-color: #f4f6f9; border-top: 1px solid #d9e1ea; }
.bp-links-inner {
    max-width: var(--mdir-max);
    margin: 0 auto;
    padding: 2.25rem var(--mdir-gutter) 2.5rem;
}
.bp-links-head {
    margin: 0 0 1.1rem;
    font-size: 1.3125rem;
    font-weight: 700;
    color: #0f1d2f;                        /* 15.68:1 on #f4f6f9 */
}
.bp-links-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
    gap: 0.9rem;
    list-style: none; margin: 0; padding: 0;
}

.bp-link-card,
.bp-link-card:link,
.bp-link-card:visited {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    height: 100%;
    box-sizing: border-box;
    padding: 1.1rem 1.2rem;
    background-color: #ffffff;
    border: 1px solid #d9e1ea;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;                        /* 14.63:1 */
}
.bp-link-card:hover,
.bp-link-card:active,
.bp-link-card:focus {
    border-color: #1e40af;
    box-shadow: 0 2px 10px rgba(15,29,47,0.08);
    text-decoration: none;
}
.bp-link-card:focus-visible { outline: 3px solid #1e40af; outline-offset: 3px; }

.bp-link-icon  { color: #1e40af; flex-shrink: 0; }   /* 8.72:1 */
.bp-link-body  { display: flex; flex-direction: column; gap: 0.15rem; flex: 1 1 auto; min-width: 0; }
.bp-link-label {
    display: flex; align-items: center; gap: 0.45rem;
    font-size: 1rem; font-weight: 700; color: #0f1d2f;
}
.bp-link-count {
    font-size: 0.75rem; font-weight: 700;
    background-color: #eef2f6; color: #334155;        /* 9.85:1 */
    border-radius: 999px; padding: 0.05rem 0.5rem;
}
.bp-link-blurb { font-size: 0.875rem; line-height: 1.45; color: #475569; }  /* 7.58:1 */
.bp-link-card .mdir-icon:last-child { color: #1e40af; flex-shrink: 0; }

@media (max-width: 600px) {
    .bp-links-inner { padding: 1.5rem var(--mdir-gutter) 1.75rem; }
    .bp-link-card { min-height: 44px; }
}

/* --- popular search links ------------------------------------------------ */
.bp-searches { min-width: 0; }
.bp-foot-head-2 { margin-top: 1.75rem !important; }
.bp-search-links { list-style: none; margin: 0; padding: 0; }
.bp-search-links li {
    display: flex; align-items: baseline; gap: 0.6rem;
    padding: 0.4rem 0; border-bottom: 1px solid #eef2f6;
    font-size: 0.9375rem;
}
.bp-search-links a:link, .bp-search-links a:visited { color: #1e40af; text-decoration: none; }  /* 8.72:1 */
.bp-search-links a:hover, .bp-search-links a:active { color: #1e3a8a; text-decoration: underline; }
.bp-search-links a:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }
.bp-search-count {
    margin-left: auto; white-space: nowrap;
    font-size: 0.8125rem; font-weight: 700;
    background-color: #eef2f6; color: #334155;                                                   /* 9.85:1 */
    border-radius: 999px; padding: 0.05rem 0.5rem;
}
.bp-search-none { font-size: 0.9375rem; color: #475569; margin: 0; }                             /* 7.58:1 */

/* ==========================================================================
   v1.32.0 — BATHROOMS FILTER + EXPANDED REFINE PANEL
   ========================================================================== */

/* Refine holds six groups now, so it needs more room than a single column. */
.bp-fmenu-wide {
    min-width: 22rem !important;
    max-width: min(34rem, calc(100vw - 2rem));
    padding: 1rem 1.1rem 1.1rem;
    max-height: min(30rem, 70vh);
    overflow-y: auto;
}
.bp-fgroup { border: 0; margin: 0 0 1rem; padding: 0; }
.bp-fgroup:last-of-type { margin-bottom: 0.75rem; }
.bp-fgroup legend,
.bp-flabel {
    display: block;
    padding: 0;
    margin: 0 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #475569;                       /* 7.58:1 */
}
.bp-fgroup label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0;
    font-size: 0.9375rem;
    color: #1e293b;                       /* 14.63:1 */
    cursor: pointer;
}
.bp-fgroup label:focus-within { color: #1e40af; }
.bp-fgroup input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 0.5rem 0.65rem;
    font-family: inherit;
    font-size: 1rem;
    background-color: #ffffff;
    color: #1a1a1a;                       /* 17.40:1 */
    border: 2px solid #cbd5e1;
    border-radius: 8px;
}
.bp-fgroup input:focus-visible {
    outline: 3px solid #1e40af;
    outline-offset: 2px;
}

.bp-fapply {
    width: 100%;
    min-height: 44px;
    margin-top: 0.5rem;
    padding: 0.6rem 1rem;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 8px;
    background-color: #1e40af;
    color: #ffffff;                       /* 8.72:1 */
    border: 2px solid #1e40af;
}
.bp-fapply:hover, .bp-fapply:focus, .bp-fapply:active {
    background-color: #1e3a8a;
    color: #ffffff;                       /* 10.36:1 */
    border-color: #1e3a8a;
}
.bp-fapply:focus-visible { outline: 3px solid #7dd3fc; outline-offset: 3px; }

@media (max-width: 900px) {
    .bp-fmenu-wide { min-width: 0 !important; max-width: none; max-height: none; }
}

/* ==========================================================================
   v1.33.0 — SIDEBAR LINKS

   Every base page now lives under /homes-near/{base}/, and the links to the
   installation's other pages sit in the sidebar rather than in a block below
   the results, where they were competing with the listings for attention.
   ========================================================================== */

.bp-side-links { list-style: none; margin: 0; padding: 0; }
.bp-side-links li + li { border-top: 1px solid #eef2f6; }
.bp-side-links a {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 0;
    min-height: 44px;
    box-sizing: border-box;
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
}
.bp-side-links a:link, .bp-side-links a:visited { color: #1e293b; }      /* 14.63:1 */
.bp-side-links a:hover, .bp-side-links a:active { color: #1e40af; }      /* 8.72:1 */
.bp-side-links a:focus-visible { outline: 3px solid #1e40af; outline-offset: 2px; }
.bp-side-links a .mdir-icon:first-child { color: #1e40af; flex-shrink: 0; }
.bp-side-links a:hover .mdir-icon { color: inherit; }
.bp-side-link-label { flex: 1 1 auto; min-width: 0; }
.bp-side-link-count {
    flex: 0 0 auto;
    font-size: 0.75rem; font-weight: 700;
    background-color: #eef2f6; color: #334155;                            /* 9.85:1 */
    border-radius: 999px; padding: 0.05rem 0.5rem;
}
.bp-side-links a:hover .bp-side-link-count { background-color: #dbeafe; color: #1e40af; }

/* ==========================================================================
   v1.34.0 — PROPERTY PAGE READABILITY

   The property page kept its original palette while the base page was
   rebalanced, so its body text, links and labels were all sitting between
   3.77:1 and 4.77:1. The tokens are corrected in the template; these two sit
   on the tinted panel where --c-steel lands exactly on 7.00, so they take a
   darker value.
   ========================================================================== */

.sp-price-type,
.sp-modal-x { color: #334155 !important; }   /* 9.56:1 on #f4f6f9 */

/* Body copy: the description is the main thing on the page. */
.sp-section-body,
.sp-section-body p { color: #1e293b; font-size: 1rem; line-height: 1.7; }   /* 14.63:1 */
.sp-stat-value { color: #0f1d2f; }
.sp-features li { color: #1e293b; }

/* Clear button on the business archive: #475569 on #e2e8f0 is 6.15. */
.mdb-btn-clear { background-color: #e2e8f0 !important; color: #1e293b !important; }   /* 11.7:1 */
.mdb-btn-clear:hover,
.mdb-btn-clear:focus { background-color: #cbd5e1 !important; color: #0f172a !important; }  /* 12.9:1 */

/* ==========================================================================
   v1.36.0 — EXPANDED LISTING FIELDS
   ========================================================================== */

.mdl-featureset { border: 0; margin: 0 0 1.5rem; padding: 0; }
.mdl-featureset legend {
    padding: 0; margin: 0 0 0.5rem;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em;
    text-transform: uppercase; color: #1e40af;              /* 8.72:1 */
}
.mdl-feature { display: flex; align-items: flex-start; gap: 0.5rem; }
.mdl-feature.has-help { align-items: flex-start; }
.mdl-feature-help {
    display: block; margin-top: 0.1rem;
    font-size: 0.8125rem; line-height: 1.4; font-weight: 400;
    color: #475569;                                          /* 7.58:1 */
}

/* Sub-labels inside the Refine panel's must-have list. */
.bp-fsub {
    margin: 0.75rem 0 0.3rem;
    font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em;
    text-transform: uppercase; color: #1e40af;
}
.bp-fsub:first-of-type { margin-top: 0; }

/* Feature chips on the listing page. */
.sp-feat-chip {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.3rem 0.7rem; margin: 0 0.35rem 0.35rem 0;
    border-radius: 999px;
    font-size: 0.875rem; font-weight: 600;
    background-color: #eef2f6; color: #334155;               /* 9.85:1 */
}
.sp-feat-chip.is-military {
    background-color: #dbeafe; color: #1e3a8a;               /* 8.95:1 */
}
.sp-feat-chip .mdir-icon { color: currentColor; }

/* ==========================================================================
   v1.37.0 — CONTACT CARD READABILITY

   The card's labels were rgba(255,255,255,0.4) on navy — 3.75:1. Transparency
   is the trap: the same alpha reads differently on every surface it lands on,
   and this card sits on a gradient. Solid values throughout.
   ========================================================================== */

.sp-c-label {
    color: #cbd5e1 !important;          /* 11.43:1 — was 3.75 */
    font-size: 0.875rem !important;
    font-weight: 600 !important;
}
.sp-c-value  { color: #ffffff !important; font-size: 0.9375rem !important; }   /* 16.98:1 */
.sp-c-row    { padding: 0.65rem 1.25rem !important; }
.sp-c-row + .sp-c-row { border-top: 1px solid rgba(255,255,255,0.12) !important; }

.sp-c-value a:link, .sp-c-value a:visited { color: #7dd3fc !important; }       /* 10.18:1 */
.sp-c-value a:hover, .sp-c-value a:active { color: #ffffff !important; }
.sp-c-value a:focus-visible { outline: 3px solid #7dd3fc; outline-offset: 2px; }

.sp-contact-price-label { color: #7dd3fc !important; font-size: 0.6875rem !important; }
.sp-contact-price       { color: #ffffff !important; }

/* "Edit This Listing" was sky blue on a 10%-sky tint — 1.98:1. */
.sp-contact-edit,
.sp-contact-edit:link,
.sp-contact-edit:visited {
    background-color: #ebf8fe !important;
    color: #1e40af !important;          /* 8.05:1 */
    font-weight: 600;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.sp-contact-edit:hover,
.sp-contact-edit:active { background-color: #d6f0fb !important; color: #1e3a8a !important; }

/* Share and Copy Link sat on the card at low contrast. */
.sp-ca-btns { display: flex; gap: 0.5rem; padding: 0 1.25rem 0.875rem; }
.sp-ca-share { flex: 1 1 0; min-height: 44px; }

/* SHARE is .sp-ca-fb, a different class from the Copy Link button — #60a5fa on
   a 15% blue tint over navy is 5.67:1, which is why it stayed unreadable after
   the last pass. Solid surface, solid text. */
.sp-ca-fb,
.sp-ca-fb:link,
.sp-ca-fb:visited {
    background-color: #16335c !important;
    color: #dbeafe !important;          /* 11.4:1 */
    font-size: 0.8125rem !important;
    font-weight: 700 !important;
    min-height: 44px;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.sp-ca-fb:hover,
.sp-ca-fb:active {
    background-color: #1e4785 !important;
    color: #ffffff !important;          /* 10.9:1 */
    text-decoration: none;
}
.sp-ca-fb:focus-visible { outline: 3px solid #7dd3fc !important; outline-offset: 2px; }

/* Both action buttons share a row, so they should share a height. */
.sp-contact-actions { gap: 0.6rem !important; padding: 0.75rem 1.25rem 1rem !important; }
.sp-contact-actions a,
.sp-contact-actions button { flex: 1 1 0; font-size: 0.8125rem !important; letter-spacing: 0.02em; }

/* Toolbar close and the edit bar's button both sat on dark surfaces with
   light-surface colours. */
.sp-tool-close { color: #cbd5e1 !important; }                    /* 11.43:1 on navy */
.sp-edit-bar a,
.sp-edit-bar a:link,
.sp-edit-bar a:visited {
    background-color: #ffffff !important;
    color: #064e3b !important;                                   /* 9.72:1 */
    font-weight: 700;
}
.sp-edit-bar a:hover, .sp-edit-bar a:active {
    background-color: #ecfdf5 !important; color: #064e3b !important;
}

/* Business gallery — uploaded since launch, never rendered until now. */
.mdb-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
    gap: 0.6rem;
    list-style: none; margin: 0; padding: 0;
}
.mdb-gallery img {
    width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
    border-radius: 8px; display: block;
}
.mdb-gallery a:focus-visible { outline: 3px solid #1e40af; outline-offset: 3px; border-radius: 8px; }
