/**
 * UrbanScope - Session UI (profile chip, dropdown, client notifications, login notice)
 */

/* User profile badge hidden until authenticated */
html.auth-pending .user-profile-badge {
    visibility: hidden;
}

/* Pages that require login stay hidden until the check passes */
html.auth-checking body {
    visibility: hidden;
}

/* ---------- Client Notification Bell (public / client navbar) ---------- */
.client-notif-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.client-notif-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid #d1ddd3;
    background: #fff;
    color: #1b2e21;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s, transform 0.2s;
    padding: 0;
}

.client-notif-wrap.open .client-notif-btn {
    border-color: #2d5c39;
    background: #f4f9f5;
    box-shadow: 0 6px 18px rgba(45, 92, 57, 0.16);
}

@media (hover: hover) and (pointer: fine) {
    .client-notif-btn:hover {
        border-color: #2d5c39;
        background: #f4f9f5;
        box-shadow: 0 6px 18px rgba(45, 92, 57, 0.16);
    }
}

.client-notif-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #dc2626;
    color: #ffffff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
    pointer-events: none;
}

.client-notif-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: 340px;
    max-width: calc(100vw - 24px);
    background: #ffffff;
    border: 1px solid #d1ddd3;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
    z-index: 1250;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    text-align: left;
    overflow: hidden;
}

.client-notif-wrap.open>.client-notif-dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.client-notif-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 16px;
    border-bottom: 1px solid #e6eee8;
    background: #f8fbf9;
}

.client-notif-head strong {
    font-size: 0.92rem;
    font-weight: 800;
    color: #1b2e21;
}

.client-notif-view-all {
    font-size: 0.78rem;
    font-weight: 700;
    color: #2d5c39;
    text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
    .client-notif-view-all:hover {
        text-decoration: underline;
    }
}

.client-notif-list {
    max-height: 330px;
    overflow-y: auto;
    divide-y: 1px solid #eef3ef;
}

.client-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 16px;
    text-decoration: none;
    color: #1b2e21;
    border-bottom: 1px solid #f0f4f1;
    transition: background 0.15s;
}

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

@media (hover: hover) and (pointer: fine) {
    .client-notif-item:hover {
        background: #f3f9f4;
    }
}

.client-notif-item.unread {
    background: #eef8f1;
}

.client-notif-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #dcfce7;
    color: #15803d;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: 800;
    margin-top: 2px;
}

.client-notif-body {
    flex: 1;
    min-width: 0;
}

.client-notif-body strong {
    display: block;
    font-size: 0.84rem;
    font-weight: 700;
    color: #14532d;
    margin-bottom: 2px;
}

.client-notif-body p {
    font-size: 0.79rem;
    color: #334155;
    line-height: 1.4;
    margin: 0 0 4px;
}

.client-notif-time {
    display: block;
    font-size: 0.71rem;
    color: #64748b;
    font-weight: 600;
}

.client-notif-empty {
    padding: 28px 18px;
    text-align: center;
    color: #64748b;
    font-size: 0.84rem;
}

/* Floating Toast for Client Approval Notification */
.client-approval-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #14532d;
    color: #ffffff;
    padding: 14px 18px;
    border-radius: 14px;
    box-shadow: 0 14px 34px rgba(20, 83, 45, 0.32);
    max-width: min(400px, calc(100vw - 32px));
    opacity: 0;
    transform: translateY(16px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    text-decoration: none;
}

.client-approval-toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.client-approval-toast-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.client-approval-toast-content {
    flex: 1;
    min-width: 0;
}

.client-approval-toast-content strong {
    display: block;
    font-size: 0.88rem;
    font-weight: 800;
    margin-bottom: 2px;
    color: #ffffff;
}

.client-approval-toast-content span {
    display: block;
    font-size: 0.79rem;
    color: #dcfce7;
    line-height: 1.35;
}

.client-approval-toast-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.75);
    padding: 4px;
    margin-left: 4px;
    border-radius: 6px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background-color 0.15s ease;
    flex-shrink: 0;
}

@media (hover: hover) and (pointer: fine) {
    .client-approval-toast-close:hover {
        color: #ffffff;
        background: rgba(255, 255, 255, 0.2);
    }
}

/* ---------- Profile chip (public navbar) ---------- */
.profile-menu {
    position: relative;
    display: inline-flex;
}

.profile-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 5px 12px 5px 5px;
    background: #fff;
    border: 1.5px solid #d1ddd3;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    color: #1b2e21;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
    animation: profileIn 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.profile-menu.open .profile-chip {
    border-color: #2d5c39;
    box-shadow: 0 6px 18px rgba(45, 92, 57, 0.18);
}

@media (hover: hover) and (pointer: fine) {
    .profile-chip:hover {
        border-color: #2d5c39;
        box-shadow: 0 6px 18px rgba(45, 92, 57, 0.18);
    }
}

.profile-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #347c47, #1a3b23);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    overflow: hidden;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.profile-name {
    font-size: 0.88rem;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-chevron {
    transition: transform 0.2s;
    color: #5f7364;
}

.profile-menu.open .profile-chevron {
    transform: rotate(180deg);
}

/* ---------- Dropdown ---------- */
.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    min-width: 240px;
    background: #fff;
    border: 1px solid #d1ddd3;
    border-radius: 16px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.16);
    padding: 8px;
    z-index: 1200;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px) scale(0.98);
    transform-origin: top right;
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
    text-align: left;
}

.profile-menu.open>.profile-dropdown,
.user-profile-badge.open>.profile-dropdown {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.profile-dropdown-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px 14px;
    border-bottom: 1px solid #e6eee8;
    margin-bottom: 6px;
}

.profile-dropdown-head .profile-avatar {
    width: 42px;
    height: 42px;
    font-size: 0.9rem;
}

.profile-dropdown-head strong {
    display: block;
    font-size: 0.92rem;
    color: #1b2e21;
}

.profile-dropdown-head small {
    display: block;
    font-size: 0.76rem;
    color: #5f7364;
    max-width: 160px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown a,
.profile-dropdown button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    border: 0;
    background: transparent;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 500;
    color: #1b2e21;
    text-decoration: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.15s, color 0.15s;
}

@media (hover: hover) and (pointer: fine) {
    .profile-dropdown a:hover,
    .profile-dropdown button:hover {
        background: #eef5ef;
        color: #2d5c39;
    }
}

.profile-dropdown .signout-item {
    color: #b3382c;
}

@media (hover: hover) and (pointer: fine) {
    .profile-dropdown .signout-item:hover {
        background: #fdeeec;
        color: #b3382c;
    }
}

.profile-dropdown-divider {
    height: 1px;
    background: #e6eee8;
    margin: 6px 8px;
}

/* Inquiry page top bar badge */
.user-profile-badge {
    position: relative;
    cursor: pointer;
}

@keyframes profileIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 640px) {

    .profile-name,
    .profile-chevron {
        display: none;
    }

    .profile-chip {
        padding: 4px;
    }

    .profile-dropdown {
        min-width: 220px;
        max-width: calc(100vw - 24px);
        right: 0;
    }

    .client-notif-dropdown {
        width: min(320px, calc(100vw - 24px));
    }
}

@media (max-width: 480px) {
        .profile-dropdown,
        .client-notif-dropdown {
            position: fixed;
            top: 68px;
            right: 12px;
            left: auto;
            width: min(300px, calc(100vw - 24px));
            min-width: 0;
        }
    }

    .mobile-drawer-user {
        display: none !important;
    }

    @media (min-width: 769px) {

        .mobile-drawer-auth,
        .profile-mobile-nav-group,
        .profile-dropdown-divider,
        .nav-link-mobile-icon {
            display: none !important;
        }
    }

/* Automatically hide guest login reminders when logged in */
html.logged-in .inquiry-note,
body.logged-in .inquiry-note,
html[data-auth-state="logged-in"] .inquiry-note,
.logged-in .inquiry-note {
    display: none !important;
}

/* ==========================================================================
   Dark Mode Toggle Button & Soft Fade-In / Fade-Out Theme Animation
   ========================================================================== */
.theme-toggle-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid var(--border-color, #d1ddd3);
    background: #ffffff;
    color: var(--text-dark, #1b2e21);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: background-color 0.35s ease, border-color 0.35s ease, color 0.35s ease, box-shadow 0.3s ease, transform 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .theme-toggle-btn:hover {
        border-color: var(--green, #2d5c39);
        background: #f4f9f5;
        box-shadow: 0 6px 18px rgba(45, 92, 57, 0.16);
        transform: translateY(-1px);
    }
}

.theme-icon-wrap {
    position: relative;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.theme-icon {
    position: absolute;
    transition: opacity 0.42s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.theme-icon-moon {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.theme-icon-sun {
    opacity: 0;
    transform: rotate(75deg) scale(0.55);
    color: #fbbf24;
}

html.dark-mode .theme-icon-moon {
    opacity: 0;
    transform: rotate(-75deg) scale(0.55);
}

html.dark-mode .theme-icon-sun {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

/* Soft ambient crossfade veil when toggling themes */
.theme-fade-veil {
    display: none !important;
}

@keyframes urbanScopeThemeFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

html.theme-vt-snap,
html.theme-vt-snap *,
html.theme-vt-snap *::before,
html.theme-vt-snap *::after {
    transition: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
}

::view-transition-group(root) {
    animation-duration: 0.42s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(root) {
    animation: none;
    mix-blend-mode: normal;
    z-index: 1;
}

::view-transition-new(root) {
    animation: urbanScopeThemeFadeIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
    mix-blend-mode: normal;
    z-index: 2;
}

/* Smooth fade-in and fade-out transitions across all surfaces when switching theme */
html.theme-transitioning,
html.theme-transitioning *:not(.theme-icon),
html.theme-transitioning *::before,
html.theme-transitioning *::after {
    transition-property: background-color, color, border-color, box-shadow, fill, stroke, filter !important;
    transition-duration: 0.48s !important;
    transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !important;
    transition-delay: 0s !important;
}

/* ==========================================================================
   Dark Mode Theme Palette (html.dark-mode)
   ========================================================================== */
html.dark-mode {
    color-scheme: dark;
    --green: #3ea35d;
    --dark-green: #86efac;
    --light-green: rgba(62, 163, 93, 0.18);
    --accent-green: #6ee7b7;
    --text-dark: #e7f0e9;
    --text-muted: #9ab09f;
    --border-color: #26392c;
    --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html.dark-mode body {
    background-color: #0e1611;
    color: var(--text-dark);
}

/* Navbar & Topbars */
html.dark-mode .navbar,
html.dark-mode .inquiry-topbar,
html.dark-mode .history-topbar {
    background-color: rgba(14, 22, 17, 0.94);
    border-bottom: 1px solid #223327;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

html.dark-mode .theme-toggle-btn,
html.dark-mode .client-notif-btn,
html.dark-mode .profile-chip {
    background: #17241c;
    border-color: #2b4031;
    color: #e7f0e9;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .theme-toggle-btn:hover,
    html.dark-mode .client-notif-btn:hover,
    html.dark-mode .profile-chip:hover {
        background: #203327;
        border-color: #4ade80;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    }
}

html.dark-mode .brand-logo {
    filter: brightness(1.45) saturate(1.15) drop-shadow(0 0 6px rgba(134, 239, 172, 0.22));
}

html.dark-mode .profile-chevron {
    color: #cfe3d4 !important;
}

html.dark-mode .profile-menu.open .profile-chevron {
    color: #86efac !important;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .profile-chip:hover .profile-chevron {
        color: #86efac !important;
    }
}

html.dark-mode .client-notif-btn svg {
    stroke: #e8f5ec !important;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .client-notif-btn:hover svg {
        stroke: #86efac !important;
    }
}

html.dark-mode .client-notif-icon {
    background: #1f3526 !important;
    color: #86efac !important;
    border: 1px solid #2f523a !important;
}

html.dark-mode .profile-dropdown a svg,
html.dark-mode .profile-dropdown button svg {
    color: #86efac;
    stroke: currentColor;
}

html.dark-mode .hamburger-line {
    background-color: #e8f5ec !important;
}

html.dark-mode .property-specs svg,
html.dark-mode .card-specs svg,
html.dark-mode .spec-item svg,
html.dark-mode .property-loc svg,
html.dark-mode .summary-loc svg,
html.dark-mode .summary-specs svg,
html.dark-mode .contact-item svg,
html.dark-mode .search-wrap svg,
html.dark-mode .location-header svg {
    color: #86efac !important;
    stroke: currentColor;
}

html.dark-mode .login-btn,
html.dark-mode .go-back-btn,
html.dark-mode .history-pill-link {
    background-color: #17241c;
    color: #d8ebe0;
    border-color: #2e4535;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .login-btn:hover,
    html.dark-mode .go-back-btn:hover,
    html.dark-mode .history-pill-link:hover {
        background-color: #213528;
        border-color: #4ade80;
        color: #86efac;
    }
}

/* Dropdowns (Profile & Notifications) */
html.dark-mode .profile-dropdown,
html.dark-mode .client-notif-dropdown {
    background: #152119;
    border-color: #293e2f;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.6);
}

html.dark-mode .profile-dropdown-head {
    background: transparent !important;
    border-bottom-color: #26392c;
}

html.dark-mode .profile-dropdown-divider {
    background: #26392c;
}

html.dark-mode .profile-dropdown-head small {
    color: #9ab09f;
}

html.dark-mode .client-notif-head {
    background: #19281f;
    border-bottom-color: #26392c;
}

html.dark-mode .client-notif-view-all {
    color: #86efac;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .client-notif-view-all:hover {
        color: #bbf7d0;
        text-decoration: underline;
    }
}

html.dark-mode .client-notif-time,
html.dark-mode .client-notif-empty {
    color: #9ab09f;
}

html.dark-mode .profile-dropdown-head strong,
html.dark-mode .client-notif-head strong,
html.dark-mode .profile-dropdown a,
html.dark-mode .profile-dropdown button,
html.dark-mode .client-notif-item {
    color: #e7f0e9;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .profile-dropdown a:hover,
    html.dark-mode .profile-dropdown button:hover,
    html.dark-mode .client-notif-item:hover {
        background: #213528;
        color: #86efac;
    }
}

html.dark-mode .client-notif-item {
    border-bottom-color: #223327;
}

html.dark-mode .client-notif-item.unread {
    background: #1c2e22;
}

html.dark-mode .client-notif-body strong {
    color: #86efac;
}

html.dark-mode .client-notif-body p {
    color: #bfd0c3;
}

/* Floating Hero Search Bar */
html.dark-mode .search-bar {
    background: #152119;
    border: 1px solid #283d2e;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
}

html.dark-mode .search-bar label {
    border-right-color: #283d2e;
    color: #9ab09f;
}

html.dark-mode .search-bar select,
html.dark-mode .search-bar input {
    background: transparent;
    color: #e7f0e9;
}

html.dark-mode .search-bar select option {
    background: #152119;
    color: #e7f0e9;
}

/* Homepage Sections & Cards */
html.dark-mode .properties-section,
html.dark-mode .testimonials-section {
    background-color: #0e1611;
}

html.dark-mode .about,
html.dark-mode .faqs-section {
    background-color: #121c16;
    border-color: #213226;
}

html.dark-mode .property-card,
html.dark-mode .testimonial-card,
html.dark-mode .faq-item {
    background-color: #16231b;
    border-color: #26392c;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.38);
}

html.dark-mode .faq-item.active {
    border-color: #3ea35d;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .property-card:hover {
        border-color: #3ea35d;
    }
}

html.dark-mode .card-title,
html.dark-mode .testimonial-author,
html.dark-mode .faq-question {
    color: #eef6f0;
}

html.dark-mode .card-loc,
html.dark-mode .about-text p,
html.dark-mode .testimonial-quote,
html.dark-mode .faq-answer-inner {
    color: #c2d4c6;
}

html.dark-mode .price,
html.dark-mode .about-text h2,
html.dark-mode .properties-header h2,
html.dark-mode .testimonials-heading h2,
html.dark-mode .faqs-heading h2 {
    color: #6ee7b7;
}

html.dark-mode .specs {
    border-top-color: #243629;
    border-bottom-color: #243629;
    color: #b7cabe;
}

html.dark-mode .view-details,
html.dark-mode .view-all-pill,
html.dark-mode .sort-select-wrap select {
    background-color: #1c2d22;
    border-color: #2f4736;
    color: #e7f0e9;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .view-details:hover,
    html.dark-mode .view-all-pill:hover {
        background-color: #2d5c39;
        border-color: #3ea35d;
        color: #ffffff;
    }
}

html.dark-mode .faq-icon,
html.dark-mode .faqs-badge {
    background-color: #1f3326;
    color: #86efac;
}

html.dark-mode .faq-item.active .faq-icon {
    background-color: #3ea35d;
    color: #ffffff;
}

html.dark-mode .faq-disclaimer-note {
    background-color: #121d16;
    border-left-color: #4ade80;
    color: #c4d6c8;
}

/* Property Detail, Inquiry, History, Legal & Modals */
html.dark-mode .status-badge.available,
html[data-theme="dark"] .status-badge.available {
    background-color: rgba(62, 163, 93, 0.22) !important;
    color: #86efac !important;
    border: 1px solid rgba(134, 239, 172, 0.38) !important;
}

html.dark-mode .status-badge.sold,
html.dark-mode .status-badge.reserved,
html[data-theme="dark"] .status-badge.sold,
html[data-theme="dark"] .status-badge.reserved {
    background-color: rgba(239, 68, 68, 0.22) !important;
    color: #fca5a5 !important;
    border: 1px solid rgba(252, 165, 165, 0.38) !important;
}

html.dark-mode .s-icon-btn,
html[data-theme="dark"] .s-icon-btn {
    width: 40px;
    height: 40px;
    background-color: #17241c !important;
    border: 1.5px solid #294532 !important;
    color: #e8f5ec !important;
}

html.dark-mode .s-icon-btn svg,
html[data-theme="dark"] .s-icon-btn svg {
    stroke: #e8f5ec !important;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .s-icon-btn:hover,
    html[data-theme="dark"] .s-icon-btn:hover {
        background-color: #213528 !important;
        border-color: #4ade80 !important;
    }
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .s-icon-btn:hover svg,
    html[data-theme="dark"] .s-icon-btn:hover svg {
        stroke: #86efac !important;
    }
}

html.dark-mode .detail-page,
html.dark-mode .detail-container,
html.dark-mode .inquiry-page-container,
html.dark-mode .history-main,
html.dark-mode .history-container,
html.dark-mode .legal-page {
    background-color: transparent;
    color: #e7f0e9;
}

html.dark-mode .overview-box,
html.dark-mode .amenities-box,
html.dark-mode .specs-bar,
html.dark-mode .tcp-section,
html.dark-mode .tcp-kpi-card,
html.dark-mode .inquiry-card,
html.dark-mode .inquiry-form-card,
html.dark-mode .history-card,
html.dark-mode .empty-state,
html.dark-mode .legal-card,
html.dark-mode .legal-content-card,
html.dark-mode .legal-sidebar,
html.dark-mode .legal-toc,
html.dark-mode .modal-box,
html.dark-mode .intent-modal-box,
html.dark-mode .tcp-document-modal {
    background-color: #16231b;
    border-color: #26392c;
    color: #e7f0e9;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html.dark-mode .history-header {
    background: linear-gradient(135deg, #13281b 0%, #193824 55%, #20472e 100%);
    border: 1px solid #2b4e37;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
}

html.dark-mode .header-action-btn {
    background: #3ea35d !important;
    color: #ffffff !important;
    border: 1px solid rgba(134, 239, 172, 0.45) !important;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .header-action-btn:hover {
        background: #2f8548 !important;
        border-color: #86efac !important;
        color: #ffffff !important;
    }
}

html.dark-mode .history-stats-bar .stat-pill {
    background: rgba(13, 23, 17, 0.56) !important;
    border: 1px solid rgba(134, 239, 172, 0.22) !important;
}

html.dark-mode .spec-item {
    border-right-color: #26392c;
}

html.dark-mode .spec-icon,
html.dark-mode .inquiry-icon-circle,
html.dark-mode .tcp-doc-icon,
html.dark-mode .empty-state-icon {
    background-color: #1f3326;
    border-color: #2f4e39;
    color: #86efac;
}

html.dark-mode .spec-info strong,
html.dark-mode .detail-block h2,
html.dark-mode .inquiry-card h3,
html.dark-mode .tcp-header h2,
html.dark-mode .tcp-kpi-card strong,
html.dark-mode .tcp-doc-text h4,
html.dark-mode .tcp-document-modal-header h3,
html.dark-mode .inquiry-header h1,
html.dark-mode .section-block h3,
html.dark-mode .history-header-text h1,
html.dark-mode .stat-pill-info strong,
html.dark-mode .section-head h2,
html.dark-mode .legal-section h3,
html.dark-mode .legal-sidebar h3,
html.dark-mode .legal-contact-info h3 {
    color: #eef6f0;
}

html.dark-mode .detail-block p,
html.dark-mode .amenities-grid li,
html.dark-mode .inquiry-card > p,
html.dark-mode .tcp-header p,
html.dark-mode .tcp-doc-text p,
html.dark-mode .tcp-footnote,
html.dark-mode .inquiry-header p,
html.dark-mode .history-header-text p,
html.dark-mode .legal-section p,
html.dark-mode .legal-section ul,
html.dark-mode .legal-contact-info p {
    color: #c2d4c6;
}

html.dark-mode .carousel-arrow,
html.dark-mode .tcp-document-modal-close,
html.dark-mode .modal-back-btn,
html.dark-mode .modal-close-btn {
    background-color: #1c2d22;
    border-color: #2f4736;
    color: #e7f0e9;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .carousel-arrow:hover,
    html.dark-mode .tcp-document-modal-close:hover,
    html.dark-mode .modal-back-btn:hover,
    html.dark-mode .modal-close-btn:hover {
        background-color: #2d5c39;
        color: #ffffff;
    }
}

html.dark-mode .tcp-table th,
html.dark-mode .legal-table th {
    background-color: #1c2d22;
    color: #86efac;
    border-color: #293e2f;
}

html.dark-mode .tcp-table td,
html.dark-mode .legal-table td {
    background-color: transparent;
    color: #d8ebe0;
    border-color: #243629;
}

html.dark-mode .legal-table tr:nth-child(even) td {
    background-color: #19281f;
    color: #d8ebe0;
    border-color: #243629;
}

html.dark-mode .tcp-document-modal-header {
    background: #19281f;
    border-bottom-color: #26392c;
}

html.dark-mode .tcp-document-modal-image-wrap {
    background: #0f1812;
}

html.dark-mode .tcp-doc-card,
html.dark-mode .property-summary-box,
html.dark-mode .intent-card,
html.dark-mode .inquiry-mode-selector,
html.dark-mode .card-message-box,
html.dark-mode .legal-callout,
html.dark-mode .legal-contact-box,
html.dark-mode .success-card,
html.dark-mode .success-schedule-box {
    background: #1b2b21;
    border-color: #2d4534;
    color: #e7f0e9;
}

html.dark-mode .tcp-doc-btn {
    background: #2d6a3e;
    border: 1px solid #3ea35d;
    color: #ffffff;
}

html.dark-mode .legal-callout.warning,
html.dark-mode .sold-property-notice {
    background-color: rgba(217, 119, 6, 0.14);
    border-color: rgba(245, 158, 11, 0.35);
    color: #fde68a;
}

html.dark-mode .sold-property-notice strong,
html.dark-mode .sold-property-notice p {
    color: #fde68a;
}

html.dark-mode .approved-banner {
    background: rgba(34, 197, 94, 0.14);
    border-color: rgba(74, 222, 128, 0.32);
    color: #bbf7d0;
}

html.dark-mode .approved-banner strong,
html.dark-mode .approved-banner span {
    color: #bbf7d0;
}

html.dark-mode .mode-tab {
    background-color: transparent;
    border-color: transparent;
    color: #b4c8b9;
}

html.dark-mode .filter-tab {
    background-color: #16231b;
    border-color: #293e2f;
    color: #b4c8b9;
}

html.dark-mode .mode-tab.active,
html.dark-mode .filter-tab.active {
    background-color: #284231;
    border-color: #3ea35d;
    color: #86efac;
}

html.dark-mode .section-block,
html.dark-mode .form-actions-row,
html.dark-mode .card-actions-row,
html.dark-mode .section-head,
html.dark-mode .modal-header,
html.dark-mode .modal-footer,
html.dark-mode .success-card-header {
    border-color: #243629;
}

html.dark-mode .success-modal-hero {
    background: linear-gradient(180deg, #1b2e22 0%, #16231b 100%);
    border-bottom-color: #26392c;
}

html.dark-mode .success-modal-hero h2,
html.dark-mode .success-prop-info h4,
html.dark-mode .success-schedule-info strong,
html.dark-mode .success-client-item strong {
    color: #eef6f0;
}

html.dark-mode .success-modal-hero p,
html.dark-mode .success-note {
    color: #b4c8b9;
}

html.dark-mode .modal-footer.success-modal-footer {
    background: transparent;
    border-top-color: #243629;
}

html.dark-mode .cancel-btn,
html.dark-mode .btn-secondary,
html.dark-mode .btn-modify,
html.dark-mode .btn-contact-secondary {
    background-color: #1c2d22;
    border-color: #2f4736;
    color: #e7f0e9;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .cancel-btn:hover,
    html.dark-mode .btn-secondary:hover,
    html.dark-mode .btn-modify:hover,
    html.dark-mode .btn-contact-secondary:hover {
        background-color: #263d2e;
        border-color: #4ade80;
        color: #86efac;
    }
}

html.dark-mode .toc-list a {
    color: #b4c8b9;
}

html.dark-mode .toc-list a.active {
    background-color: #1f3326;
    color: #86efac;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .toc-list a:hover {
        background-color: #1f3326;
        color: #86efac;
    }
}

html.dark-mode input,
html.dark-mode select,
html.dark-mode textarea,
html.dark-mode .form-input,
html.dark-mode .form-select,
html.dark-mode .form-textarea,
html.dark-mode .search-input {
    background-color: #111b15;
    border-color: #2b4031;
    color: #e7f0e9;
}

html.dark-mode input[readonly] {
    background-color: #142018 !important;
    color: #9ab09f !important;
}

html.dark-mode input::placeholder,
html.dark-mode textarea::placeholder {
    color: #78907f;
}

/* Mobile Drawer in Dark Mode */
@media (max-width: 768px) {
    html.dark-mode .navbar nav {
        background-color: #131f17;
        border-bottom-color: #26392c;
    }

    html.dark-mode .mobile-drawer-auth {
        border-top-color: #26392c;
    }

    html.dark-mode .mobile-drawer-auth .m-login-btn {
        border-color: #2f4736;
        color: #e7f0e9;
    }
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .signup-btn:hover,
    html.dark-mode .inquire-btn:hover,
    html.dark-mode .tcp-doc-btn:hover,
    html.dark-mode .submit-btn:hover,
    html.dark-mode .btn-primary:hover,
    html.dark-mode .new-inquiry-btn:hover,
    html.dark-mode .btn-save:hover,
    html.dark-mode .btn-confirm:hover,
    html.dark-mode .btn-contact-primary:hover,
    html.dark-mode .mobile-drawer-auth .m-signup-btn:hover {
        background-color: #2f8548;
        border-color: #3ea35d;
        color: #ffffff;
    }
}

html.dark-mode .cta-overlay {
    bottom: -2px;
    background: linear-gradient(
        180deg,
        rgba(10, 22, 14, 0.48) 0%,
        rgba(10, 22, 14, 0.54) 45%,
        rgba(10, 20, 13, 0.66) 62%,
        rgba(9, 18, 12, 0.80) 74%,
        rgba(9, 16, 11, 0.94) 88%,
        #090f0b 98%,
        #090f0b 100%
    );
}

html.dark-mode .footer {
    background-color: #090f0b;
    border-top: none !important;
}

/* Natural Photo Clarity in Dark Mode (No Dimming) */
html.dark-mode .property-image img,
html.dark-mode .main-carousel img,
html.dark-mode .thumb img,
html.dark-mode .main-image img,
html.dark-mode .thumbnail-grid img,
html.dark-mode .about-image-card img,
html.dark-mode #propThumb,
html.dark-mode .success-prop-thumb,
html.dark-mode .showcase-panel img {
    filter: none;
    transition: transform 0.35s ease;
}

html.dark-mode .thumb.active img,
html.dark-mode .thumbnail-grid img.active {
    filter: none;
}

@media (hover: hover) and (pointer: fine) {
    html.dark-mode .property-card:hover .property-image img,
    html.dark-mode .main-carousel:hover img,
    html.dark-mode .thumb:hover img,
    html.dark-mode .main-image:hover img,
    html.dark-mode .thumbnail-grid img:hover {
        filter: none;
    }
}

html.dark-mode .property-image::after {
    display: none !important;
}

/* ========================================================
   Floating Contact Action Button (FAB)
   ======================================================== */
.contact-fab {
    position: fixed;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    right: 24px;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    pointer-events: none;
}

.contact-fab.open ~ .back-to-top-btn,
body:has(.contact-fab.open) .back-to-top-btn {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.has-contact-fab .client-approval-toast,
body.has-contact-fab .toast-notice {
    bottom: 96px !important;
}

.fab-main-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2d5c39 0%, #1e4228 100%);
    color: #ffffff;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 28px rgba(29, 66, 38, 0.42);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    pointer-events: auto;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease, background 0.25s ease;
}

@media (hover: hover) and (pointer: fine) {
    .fab-main-btn:hover {
        transform: scale(1.06);
        box-shadow: 0 14px 32px rgba(29, 66, 38, 0.55);
    }
}

.fab-main-btn:active {
    transform: scale(0.96);
}

.fab-icon-chat,
.fab-icon-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.2s ease;
}

.fab-icon-chat {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.fab-icon-close {
    opacity: 0;
    transform: rotate(-90deg) scale(0.5);
}

.contact-fab.open .fab-icon-chat {
    opacity: 0;
    transform: rotate(90deg) scale(0.5);
}

.contact-fab.open .fab-icon-close {
    opacity: 1;
    transform: rotate(0deg) scale(1);
}

.fab-menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    margin-bottom: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
                visibility 0s linear 0.24s;
}

.contact-fab.open .fab-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
    transition: opacity 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
                transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1),
                visibility 0s linear 0s;
}

.fab-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px 8px 12px;
    border-radius: 999px;
    background: #ffffff;
    color: #1b2e21;
    text-decoration: none;
    font-size: 0.86rem;
    font-weight: 700;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.16);
    border: 1px solid #d5e2d8;
    pointer-events: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.contact-fab.open .fab-action-btn {
    pointer-events: auto;
}

@media (hover: hover) and (pointer: fine) {
    .fab-action-btn:hover {
        transform: translateX(-4px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    }
}

.fab-action-btn.fab-msgr {
    color: #0078ff;
    border-color: #bfdbfe;
}
@media (hover: hover) and (pointer: fine) {
    .fab-action-btn.fab-msgr:hover {
        background: #eff6ff;
    }
}

.fab-action-btn.fab-sms {
    color: #166534;
    border-color: #bbf7d0;
}
@media (hover: hover) and (pointer: fine) {
    .fab-action-btn.fab-sms:hover {
        background: #f0fdf4;
    }
}

.fab-action-btn.fab-call {
    color: #047857;
    border-color: #a7f3d0;
}
@media (hover: hover) and (pointer: fine) {
    .fab-action-btn.fab-call:hover {
        background: #ecfdf5;
    }
}

/* Dark mode for Contact FAB */
html.dark-mode .fab-main-btn {
    background: linear-gradient(135deg, #3ea35d 0%, #1e5c33 100%);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6);
}

html.dark-mode .fab-action-btn {
    background: #16241c;
    border-color: #2b3f30;
    color: #e7f0e9;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

html.dark-mode .fab-action-btn.fab-msgr {
    color: #60a5fa;
    border-color: #1e3a8a;
}
@media (hover: hover) and (pointer: fine) {
    html.dark-mode .fab-action-btn.fab-msgr:hover {
        background: #172554;
    }
}

html.dark-mode .fab-action-btn.fab-sms {
    color: #86efac;
    border-color: #14532d;
}
@media (hover: hover) and (pointer: fine) {
    html.dark-mode .fab-action-btn.fab-sms:hover {
        background: #143520;
    }
}

html.dark-mode .fab-action-btn.fab-call {
    color: #6ee7b7;
    border-color: #064e3b;
}
@media (hover: hover) and (pointer: fine) {
    html.dark-mode .fab-action-btn.fab-call:hover {
        background: #06392c;
    }
}

/* ========================================================
   First-Time Visitor Chat FAB Wiggle Animation
   ======================================================== */
@keyframes fabWiggle {
    0% {
        transform: rotate(0deg) scale(1);
    }
    4% {
        transform: rotate(-13deg) scale(1.12);
    }
    8% {
        transform: rotate(13deg) scale(1.12);
    }
    12% {
        transform: rotate(-9deg) scale(1.1);
    }
    16% {
        transform: rotate(9deg) scale(1.1);
    }
    20% {
        transform: rotate(-5deg) scale(1.06);
    }
    24% {
        transform: rotate(5deg) scale(1.04);
    }
    28% {
        transform: rotate(0deg) scale(1);
    }
    /* Brief pause between waves */
    42% {
        transform: rotate(0deg) scale(1);
    }
    /* Second wave */
    46% {
        transform: rotate(-13deg) scale(1.12);
    }
    50% {
        transform: rotate(13deg) scale(1.12);
    }
    54% {
        transform: rotate(-9deg) scale(1.1);
    }
    58% {
        transform: rotate(9deg) scale(1.1);
    }
    62% {
        transform: rotate(-5deg) scale(1.06);
    }
    66% {
        transform: rotate(5deg) scale(1.04);
    }
    70%, 100% {
        transform: rotate(0deg) scale(1);
    }
}

@keyframes fabPulseLight {
    0% {
        box-shadow: 0 10px 28px rgba(29, 66, 38, 0.42), 0 0 0 0 rgba(45, 92, 57, 0.65);
    }
    18% {
        box-shadow: 0 12px 32px rgba(29, 66, 38, 0.5), 0 0 0 14px rgba(45, 92, 57, 0);
    }
    42% {
        box-shadow: 0 10px 28px rgba(29, 66, 38, 0.42), 0 0 0 0 rgba(45, 92, 57, 0.65);
    }
    60% {
        box-shadow: 0 12px 32px rgba(29, 66, 38, 0.5), 0 0 0 14px rgba(45, 92, 57, 0);
    }
    72%, 100% {
        box-shadow: 0 10px 28px rgba(29, 66, 38, 0.42), 0 0 0 0 rgba(45, 92, 57, 0);
    }
}

@keyframes fabPulseDark {
    0% {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(62, 163, 93, 0.7);
    }
    18% {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 0 14px rgba(62, 163, 93, 0);
    }
    42% {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(62, 163, 93, 0.7);
    }
    60% {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.7), 0 0 0 14px rgba(62, 163, 93, 0);
    }
    72%, 100% {
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.6), 0 0 0 0 rgba(62, 163, 93, 0);
    }
}

.contact-fab.fab-wiggle .fab-main-btn {
    animation: fabWiggle 2.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both,
               fabPulseLight 2.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    transform-origin: center center;
    z-index: 2;
}

html.dark-mode .contact-fab.fab-wiggle .fab-main-btn {
    animation: fabWiggle 2.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both,
               fabPulseDark 2.8s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

.contact-fab.open .fab-main-btn {
    animation: none !important;
}

@media (hover: hover) and (pointer: fine) {
    .contact-fab.fab-wiggle .fab-main-btn:hover {
        animation: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-fab.fab-wiggle .fab-main-btn {
        animation: none !important;
    }
}
