/* Chat list */
#fixcy-chat-list .chat-item{padding:10px 12px;border-radius:10px;margin-bottom:2px;display:flex;gap:10px;align-items:center;transition:background .12s ease, box-shadow .12s ease, transform .05s ease;background:#f7f8f9}
#fixcy-chat-list .chat-item:hover{background:#eef8f0;box-shadow:inset 3px 0 0 #3ca350}
#fixcy-chat-list .chat-item.active{background:#eef8f0;box-shadow:inset 3px 0 0 #3ca350}
#fixcy-chat-list .chat-item a{display:block;text-decoration:none;color:#1b1e22;font-weight:600;font-size:14.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#fixcy-chat-list .chat-item .meta{margin-top:3px;}
#fixcy-chat-list .fixcy-chatlist-line{font-size:12px;color:#9aa0a6;line-height:1.6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#fixcy-chat-list .fixcy-chatlist-line + .fixcy-chatlist-line{margin-top:1px}
#fixcy-chat-list .fixcy-i18n-label{color:#b0b5ba;font-weight:500}
#fixcy-chat-list .fixcy-i18n-value{color:#8a9096}
#fixcy-chat-list .avatar-wrap img,
#fixcy-chat-list .fixcy-chatlist-avatar img{border-radius:50%;box-shadow:0 0 0 2px #fff, 0 0 0 3px #eef0f1;display:block}
#fixcy-chat-list .fixcy-status-dot > span:first-child{box-shadow:0 0 0 2px #fff}
#fixcy-chat-list .fixcy-badge{box-shadow:0 1px 3px rgba(60,163,80,0.35)}

/* make side content a column so thread can grow and form sits at bottom */
#fixcy-side-content { display:flex; flex-direction:column; flex:1 1 0%; overflow:auto; padding:12px; background:#fafafa; }

/* message thread should grow to fill available space */
#fixcy-message-thread { flex:1 1 auto; overflow-y:auto; padding:12px; background:#fff; border-radius:8px; max-height:none; }

/* message rows must allow message body to shrink in flex layouts */
#fixcy-message-thread .msg-row{margin-bottom:12px; display:flex; gap:10px; align-items:flex-start;}
#fixcy-message-thread .msg-row[data-msgid]{outline:0}
#fixcy-message-thread .msg-avatar{flex:0 0 36px}
#fixcy-message-thread .msg-body{flex:1 1 auto; min-width:0; word-break:break-word; overflow-wrap:anywhere; white-space:pre-wrap;}
#fixcy-message-thread .msg-you{background:#e8f5e9;padding:10px;border-radius:10px;display:inline-block;max-width:100%;box-shadow:0 1px 0 rgba(0,0,0,0.02)}
#fixcy-message-thread .msg-other{background:#f7f7f8;padding:10px;border-radius:10px;display:inline-block;max-width:100%}
#fixcy-message-thread .msg-body a{word-break:break-all; overflow-wrap:anywhere; color:inherit; text-decoration:underline;}

.fixcy-badge{background:#3ca350;color:#fff;padding:4px 8px;border-radius:12px;font-size:12px}
.fixcy-toast a{color:#3ca350;font-weight:600;text-decoration:none}

/* ensure send form does not collapse and sits after the growing thread */
#fixcy-send-form { flex: 0 0 auto; margin-top: 12px; display:flex; align-items:flex-start; gap:8px; }

/* ensure there's always room at bottom of thread so last message isn't hidden when send form is fixed */
#fixcy-message-thread { padding-bottom:48px; overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }

/* Floating button */
.fixcy-floating-message-btn{}

/* Modal/side panel adjustments */
#fixcy-side-panel {}
#fixcy-side-panel .fixcy-modal-panel {}

/* Mobile layout: keep behavior where form becomes fixed to viewport bottom */
@media(max-width:800px){
  #fixcy-messages-wrap{flex-direction:column}
  #fixcy-chat-list{display:block;width:100%!important;max-width:100%!important;height:280px!important;order:1}
  #fixcy-chat-content{width:100%;height:calc(100vh - 320px);order:2}
  .fixcy-floating-message-btn{display:flex}

  /* on mobile ensure the send form is visually elevated and thread reserves space */
  #fixcy-send-form{
     box-shadow: 0 -6px 24px rgba(0,0,0,0.06);
     position:fixed;
     left:12px;
     right:12px;
     bottom:55px;
     display:flex;
     gap:8px;
     padding:8px;
     background:rgba(255,255,255,0.98);
     z-index:1000002;
     border-top:1px solid #eee;
     border-radius:8px;
  }

  /* thread padding bottom uses CSS var if available, otherwise fallback to a large mobile buffer */
  #fixcy-message-thread {
     padding-bottom: calc(var(--fixcy-form-height, 84px) + 160px);
     height:auto;
     max-height:none;
     overflow-y:auto;
     overscroll-behavior:contain;
     -webkit-overflow-scrolling:touch;
  }

  /* when side panel/modal open, lock background content */
  html.fixcy-modal-open, body.fixcy-modal-open { height:100%; overflow:hidden; /* keep other modal behavior */ }

  /* ensure the map can receive touch gestures even when modal-open class is set */
  #fixcy-location-map, #fixcy-location-modal { touch-action:none; -ms-touch-action:none; -webkit-tap-highlight-color:transparent; pointer-events:auto; }
	  
	  /* Backdrop used to absorb touches when mobile chat is open */
	  #fixcy-chat-backdrop { position:fixed; inset:0; z-index:999997; background:transparent; }

	  /* ensure the chat header absorbs touches and won't propagate scroll to the page behind */
	  #fixcy-chat-header { touch-action:manipulation; -webkit-touch-callout:none; overscroll-behavior:contain; pointer-events:auto; z-index:999999; }

	  /* ensure chat content doesn't allow overscroll into background */
	  #fixcy-chat-content { overscroll-behavior:contain; -webkit-overflow-scrolling:touch; }
}

/* seen tick styling */
.fixcy-seen-tick{color:#3ca350;font-weight:700;margin-left:6px}
/* =========================================================
   FIX.CY — Official Verified Badge
   ========================================================= */
.fixcy-verified-badge {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 20px !important;
    height: 20px !important;
    margin-left: 5px !important;
    margin-bottom: 5px !important;
    background: #3ca350 !important;
    color: #fff !important;
    border-radius: 50% !important;
    font-family: Arial, sans-serif !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    text-decoration: none !important;
    border: 1.5px solid #3ca350 !important;
    box-shadow:
        0 1px 3px rgba(0,0,0,.15),
        0 0 0 1px rgba(60,163,80,.10) !important;
    box-sizing: border-box !important;
}
.fixcy-msg-time{font-size:11.5px;color:#a0a5aa;margin-top:6px;letter-spacing:.01em}

/* small block badge in list */
.fixcy-block-badge{background:#f0f0f0;color:#333;padding:2px 8px;border-radius:8px;margin-left:6px;font-size:12px}

/* presence dot tweaks */
.avatar-wrap .fixcy-status-dot{cursor:default}
.fixcy-header-presence{display:flex;align-items:center;gap:8px}
.fixcy-header-presence .fixcy-header-dot{width:8px;height:8px;border-radius:50%;display:inline-block;margin-right:6px;border:2px solid #fff;box-sizing:content-box}

/* message avatars */
#fixcy-message-thread .msg-avatar img, #fixcy-chat-list .avatar-wrap img, #fixcy-side-content .fixcy-header-avatar img {width:70px;height:auto;border-radius:50%;object-fit:cover;display:block;}

/* ensure message avatar container doesn't collapse */
#fixcy-message-thread .msg-avatar { line-height:0; }

/* Small visual state for the pin button when a location is chosen */
#fixcy-location-btn.fixcy-location-has-value { box-shadow: 0 1px 0 rgba(0,0,0,0.05) inset; border-color:#cfdcdc; }

/* small preview image styling */
#fixcy-location-preview img{width:100%;height:auto;border-radius:6px;border:1px solid #eee;display:block}

.fixcy-location-actions a.fixcy-get-directions .directorist-icon-mask:after { background:#ffffff; }

/* ==========================================================
   Chat header — modern layout
   ========================================================== */
#fixcy-chat-header {
    position: relative;
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 12px;
    padding: 10px 4px 16px;
    border-bottom: 1px solid #eef0f1;
}
.fixcy-chat-header-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 auto;
}
.fixcy-header-btn {
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
    cursor: pointer;
    white-space: nowrap;
    transition: filter .12s ease, transform .05s ease;
}
.fixcy-header-btn:active { transform: scale(0.96); }
.fixcy-header-btn--back { background: #3ca350; color: #fff; }
.fixcy-header-btn--back:hover { filter: brightness(0.94); }
.fixcy-header-btn--settings {
    background: #f3f4f6;
    color: #444;
    font-size: 17px;
    line-height: 1;
    padding: 9px 11px;
}
.fixcy-header-btn--settings:hover { background: #e9eaed; }

.fixcy-chat-header-identity {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1 1 auto;
    min-width: 0;
}
.fixcy-header-avatar { flex: 0 0 auto; line-height: 0; }
.fixcy-header-avatar img {
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff, 0 0 0 3px #e9ebee;
    display: block;
}
.fixcy-header-info { flex: 1 1 auto; min-width: 0; }
.fixcy-header-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #1b1e22;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fixcy-header-name:hover { color: #3ca350; }
.fixcy-header-meta {
    font-size: 12.5px;
    color: #9aa0a6;
    margin-top: 2px;
    line-height: 1.5;
}
.fixcy-header-presence {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    row-gap: 2px;
    font-size: 13px;
    font-weight: 600;
    margin-top: 4px;
    line-height: 1.5;
}
.fixcy-header-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
    box-shadow: 0 0 0 2px #fff;
    flex: 0 0 auto;
}
.fixcy-header-lastseen { color: #9aa0a6; font-weight: 400; margin-left: 2px; }
.fixcy-header-lastseen .fixcy-i18n-label { color: #b0b5ba; font-weight: 500; }

/* ==========================================================
   Chat settings gear + popover — modern, cohesive dropdown
   ========================================================== */
.fixcy-settings-menu {
    background: #fff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    box-shadow: 0 16px 40px rgba(20,22,25,0.14), 0 2px 8px rgba(20,22,25,0.06);
    min-width: 210px;
    overflow: hidden;
    animation: fixcyMenuIn .12s ease-out;
}
@keyframes fixcyMenuIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.fixcy-settings-menu-list { list-style: none; margin: 0; padding: 6px; }
.fixcy-settings-menu li { margin: 0; }
.fixcy-settings-menu li + li { border-top: 1px solid #f2f2f3; margin-top: 2px; padding-top: 2px; }
.fixcy-settings-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 10px 10px;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    color: #262a2e;
    text-decoration: none;
    cursor: pointer;
    border-radius: 8px;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
}
.fixcy-settings-menu-item-icon {
    font-size: 15px;
    flex: 0 0 auto;
    width: 20px;
    text-align: center;
}
.fixcy-settings-menu-item:hover { background: #f4f5f6; color: #262a2e !important; }
.fixcy-settings-menu-item--danger { color: #d93025; }
.fixcy-settings-menu-item--danger:hover { background: #fdeceb; color: #d93025 !important; }

/* ==========================================================
   Listing context chip — rectangular card, inline in the thread
   ========================================================== */
.fixcy-listing-chip-wrap { margin: 6px 0 16px; display: flex; justify-content: center; }
.fixcy-listing-chip {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    max-width: 380px;
    border: 1px solid #e6e8ea;
    border-radius: 14px;
    background: #fff;
    text-decoration: none;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(20,22,25,0.05);
    transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease;
}
.fixcy-listing-chip:hover {
    border-color: #3ca350;
    box-shadow: 0 8px 22px rgba(60,163,80,0.18);
    transform: translateY(-1px);
}
.fixcy-listing-chip-thumb {
    width: 100px;
    height: 100px;
    min-width: 100px;
    object-fit: cover;
    display: block;
    flex: 0 0 100px;
    background: #f2f3f4;
}
.fixcy-listing-chip-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
    line-height: 1.3;
    padding: 10px 12px;
    flex: 1 1 auto;
}
.fixcy-listing-chip-label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #9aa0a6;
    font-weight: 700;
    margin-bottom: 3px;
}
.fixcy-listing-chip-title {
    font-size: 14px;
    font-weight: 700;
    color: #1b1e22;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.fixcy-listing-chip-arrow {
    display: flex;
    align-items: center;
    color: #b6bcc2;
    font-size: 20px;
    flex: 0 0 28px;
    justify-content: center;
}
.fixcy-listing-chip:hover .fixcy-listing-chip-arrow { color: #3ca350; }

@media(max-width:420px){
    .fixcy-listing-chip { max-width: 100%; }
    .fixcy-listing-chip-thumb { width: 76px; height: 76px; min-width: 76px; flex-basis: 76px; }
}

/* ==========================================================
   Shared chat photos + lightbox
   ========================================================== */
.fixcy-chat-image { transition: opacity .15s ease; }
.fixcy-chat-image:hover { opacity: 0.9; }

.fixcy-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.88);
    z-index: 1000010;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fixcy-lightbox-inner {
    position: relative;
    max-width: 92vw;
    max-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
}
.fixcy-lightbox-img {
    max-width: 92vw;
    max-height: calc(100vh - 120px);
    width: auto;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    object-fit: contain;
}
.fixcy-lightbox-close {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.fixcy-lightbox-close:hover { background: rgba(0,0,0,0.7); }
