	
#sidebar {
    width: 500px !important;
    min-width: 400px !important;
    max-width: 1000px;
    resize: horizontal;
    overflow: auto;
}
        *{box-sizing:border-box;}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;height:100vh;overflow:hidden;background:#f0f2f5;}
        .scrollbar-thin::-webkit-scrollbar{width:6px;}.scrollbar-thin::-webkit-scrollbar-thumb{background:#ccc;border-radius:3px;}
        .tag{display:inline-block;padding:2px 8px;border-radius:9999px;font-size:11px;font-weight:500;margin:1px;}
		.tag-detailarea{background:#ccfbf1;color:#0f766e;}
        .tag-district{background:#dbeafe;color:#1e40af;}.tag-budget{background:#fef3c7;color:#92400e;}.tag-unit{background:#ede9fe;color:#5b21b6;}.tag-property{background:#d1fae5;color:#065f46;}.tag-proptype{background:#fee2e2;color:#dc2626;}
        .field-tag{display:inline-flex;align-items:center;gap:3px;padding:2px 8px;border-radius:9999px;font-size:11px;margin:1px;cursor:default;}
        .field-tag .remove-btn{cursor:pointer;opacity:0.5;font-size:13px;}.field-tag .remove-btn:hover{opacity:1;color:#dc2626;}
        .field-tag .filter-btn{cursor:pointer;opacity:0.6;font-size:11px;}.field-tag .filter-btn:hover{opacity:1;}
        .chat-bg{background-color:#ECE5DD;}.bubble-in{background:#fff;border-radius:0 8px 8px 8px;}.bubble-out{background:#DCF8C6;border-radius:8px 0 8px 8px;}
        .customer-item{cursor:pointer;transition:background 0.15s;}.customer-item:hover{background:#f0f2f5;}.customer-item.active{background:#e8f5e9;}
        .filter-chip{padding:4px 12px;border-radius:16px;font-size:12px;cursor:pointer;border:1px solid #e5e7eb;background:white;transition:all 0.15s;white-space:nowrap;flex-shrink:0;}
        .filter-chip:hover{border-color:#22c55e;}.filter-chip.active{background:#22c55e;color:white;border-color:#22c55e;}
        .stage-chip{padding:4px 10px;border-radius:16px;font-size:11px;cursor:pointer;border:1px solid transparent;transition:all 0.15s;white-space:nowrap;flex-shrink:0;}
        .stage-chip:hover{opacity:0.8;}.stage-chip.active-stage{outline:2px solid #22c55e;outline-offset:1px;}
        .quick-btn{padding:4px 10px;border:1px solid #e5e7eb;border-radius:16px;font-size:12px;cursor:pointer;background:white;transition:all 0.15s;white-space:nowrap;flex-shrink:0;}.quick-btn:hover{background:#f0fdf4;border-color:#22c55e;}
        .chk-label{cursor:pointer;transition:all 0.15s;}.chk-label:hover{background:#f0fdf4;}.chk-label.checked{background:#dcfce7;border-color:#22c55e;}
        .clickable-tag{cursor:pointer;transition:all 0.15s;}.clickable-tag:hover{filter:brightness(0.9);transform:scale(1.05);}
        .smart-filter-bar{background:linear-gradient(135deg,#fef3c7,#fde68a);border-bottom:2px solid #f59e0b;}
        .toast{animation:toastIn 0.3s ease,toastOut 0.3s ease 2.7s;}@keyframes toastIn{from{opacity:0;transform:translateY(20px);}}@keyframes toastOut{to{opacity:0;transform:translateY(20px);}}
        @keyframes pulse-red{0%,100%{opacity:1;}50%{opacity:0.5;}}.rec-pulse{animation:pulse-red 1s infinite;}
        .fade-in{animation:fadeIn 0.2s ease;}@keyframes fadeIn{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}
        #login-screen{background:linear-gradient(135deg,#075E54,#128C7E);}
        .search-highlight{background:#fde68a;border-radius:2px;padding:0 2px;}.search-current{background:#f59e0b;color:white;border-radius:2px;padding:0 2px;}
        .followup-due{border-left:3px solid #f59e0b;}.followup-overdue{border-left:3px solid #ef4444;}.starred-item{background:linear-gradient(90deg,#fefce8,transparent);}.highlight-tag{outline:2px solid #f59e0b;outline-offset:-1px;}
        .media-card{background:rgba(255,255,255,0.6);border-radius:8px;padding:8px;margin-bottom:4px;}
        .dl-btn{display:inline-flex;align-items:center;gap:3px;padding:2px 8px;font-size:11px;color:#2563eb;background:rgba(37,99,235,0.08);border-radius:12px;text-decoration:none;transition:all 0.15s;}.dl-btn:hover{background:rgba(37,99,235,0.18);color:#1d4ed8;}
        .drop-overlay{position:absolute;inset:0;background:rgba(37,99,235,0.15);border:3px dashed #3b82f6;border-radius:12px;display:flex;align-items:center;justify-content:center;z-index:10;pointer-events:none;}
        .mode-tab{padding:4px 9px;border-radius:8px;font-size:12.5px;font-weight:600;cursor:pointer;transition:all 0.15s;border:none;color:rgba(255,255,255,0.6);background:transparent;white-space:nowrap;}
        .mode-tab:hover{color:white;background:rgba(255,255,255,0.1);}.mode-tab.active-tab{color:white;background:rgba(255,255,255,0.25);}
        .unread-badge{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:#25D366;color:white;font-size:11px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;line-height:1;}
        .tab-badge{min-width:16px;height:16px;padding:0 4px;border-radius:8px;background:#ef4444;color:white;font-size:10px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;line-height:1;margin-left:2px;vertical-align:middle;}
        
		/* ===== 修復 1：手機 viewport 高度（解決底部打唔到字）===== */
body {
    height: 100vh;
    height: 100dvh;           /* 動態 viewport，自動扣除瀏覽器 chrome */
    height: -webkit-fill-available; /* iOS Safari 後備 */
}

#app {
    height: 100vh;
    height: 100dvh;
    height: -webkit-fill-available;
    /* 或者用最穩陣嘅方法：*/
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
}

/* ===== 修復 2：手機頂部導航列 ===== */
@media (max-width: 768px) {

    /* --- 頂部綠色 header 整體收窄 --- */
    #sidebar > .bg-green-700 {
        padding: 4px 6px 3px;
    }

    /* --- 第一行 Tabs：橫向可捲動 --- */
    #sidebar > .bg-green-700 > div:first-child {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        justify-content: flex-start;  /* 唔居中，避免擠壓 */
        scrollbar-width: none;
        padding-bottom: 4px;
    }
    #sidebar > .bg-green-700 > div:first-child::-webkit-scrollbar {
        display: none;
    }

    .mode-tab {
        font-size: 11px;
        padding: 3px 8px;
        flex-shrink: 0;              /* 唔縮細，靠橫滾 */
        white-space: nowrap;
    }

    /* --- 第二行 Status：橫向可捲動 --- */
    #sidebar > .bg-green-700 > div:nth-child(2) {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        flex-wrap: nowrap;
        scrollbar-width: none;
        gap: 4px;
        padding-top: 3px;
    }
    #sidebar > .bg-green-700 > div:nth-child(2)::-webkit-scrollbar {
        display: none;
    }

    /* --- 底部輸入列：留安全區域 --- */
    #msg-input-bar {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }

    /* --- Reply bar 同 forward bar 都要留底 --- */
    #reply-bar, #forward-bar, #quick-reply-bar {
        padding-bottom: max(4px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 768px) {

    /* ===== 所有內容區 header 通用修復 ===== */
    
    /* CRM 聊天 header */
    #chat-view > .bg-green-700 {
        padding: 6px 8px;
        gap: 4px;
    }
    #chat-view > .bg-green-700 .flex.items-center.gap-3 {
        gap: 6px;
        min-width: 0;       /* 允許縮小 */
        flex: 1;
    }
    #chat-view > .bg-green-700 #chat-name {
        max-width: 90px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 13px;
    }
    #chat-view > .bg-green-700 #chat-phone {
        font-size: 10px;
    }
    /* 右邊按鈕組 */
    #chat-view > .bg-green-700 .flex.items-center.gap-1 {
        gap: 2px;
        flex-shrink: 0;
    }
    #chat-view > .bg-green-700 .flex.items-center.gap-1 button,
    #chat-view > .bg-green-700 .flex.items-center.gap-1 a {
        padding: 4px 6px;
        font-size: 12px;
        white-space: nowrap;
    }
    /* 「ℹ️ 資料」「🏠 樓盤資料」按鈕只顯示 icon */
    #detail-toggle-btn { font-size: 0 !important; }
    #detail-toggle-btn::before { content: 'ℹ️'; font-size: 14px; }
    #group-detail-btn { font-size: 0 !important; }
    #group-detail-btn::before { content: '🏠'; font-size: 14px; }

    /* ===== 樓盤搜尋結果 header ===== */
    #property-results-view > .bg-red-700 {
        padding: 6px 8px;
        flex-wrap: wrap;
        gap: 4px;
    }
    #property-results-view > .bg-red-700 .flex.items-center.gap-2 {
        gap: 4px;
        font-size: 12px;
    }
    #property-results-view > .bg-red-700 .font-bold {
        font-size: 13px;
    }
    #property-results-view > .bg-red-700 a,
    #property-results-view > .bg-red-700 button {
        padding: 3px 8px;
        font-size: 10px;
    }

    /* ===== 按揭結果 header ===== */
    #mortgage-results-view > .bg-red-700 {
        padding: 6px 8px;
    }
    #mortgage-results-view > .bg-red-700 a {
        padding: 3px 8px;
        font-size: 10px;
    }

    /* ===== 新聞 header ===== */
    #news-detail-view > .bg-red-700 {
        padding: 6px 8px;
    }
    #news-detail-view > .bg-red-700 a {
        padding: 3px 8px;
        font-size: 10px;
    }

    /* ===== Chat avatar 縮細 ===== */
    #chat-avatar, #chat-avatar img, #chat-avatar span {
        width: 32px !important;
        height: 32px !important;
        font-size: 14px !important;
    }
}


		
		@media(max-width:768px){
    #sidebar{position:absolute;z-index:20;height:100%;width:100%!important;min-width:0!important;max-width:100%!important;}
    #sidebar.mobile-hide{display:none!important;}
    #detail-panel{position:absolute;right:0;z-index:20;height:100%;width:100%!important;min-width:0!important;max-width:100%!important;}
    #group-detail-panel{position:absolute;right:0;z-index:20;height:100%;width:100%!important;min-width:0!important;max-width:100%!important;}
}

/* ===== Fix: Property sidebar — 搜尋按鈕 + 單位標籤 ===== */

/* 移除 number input 原生 spinner，令 flex 正常分配空間 */
#property-sidebar-content input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    min-width: 0;
}
#property-sidebar-content input[type="number"]::-webkit-inner-spin-button,
#property-sidebar-content input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 確保 unit label (萬/呎/年) 永遠顯示 */
#property-sidebar-content .flex.gap-1\.5.items-center > span.shrink-0 {
    flex-shrink: 0;
    min-width: 32px;
    text-align: right;
}

		.tag-proptype{background:#fee2e2;color:#dc2626;}

        /* ===== News Mode ===== */
        .news-thumb{width:64px;height:48px;border-radius:6px;object-fit:cover;background:#f3f4f6;flex-shrink:0;}
        .news-cat{display:inline-block;padding:1px 8px;border-radius:9999px;font-size:10px;font-weight:600;background:#fee2e2;color:#dc2626;margin-top:4px;}
        .news-detail-body{line-height:1.85;color:#374151;font-size:15px;}
        .news-detail-body p{margin-bottom:14px;}
        .news-share-btn{display:inline-flex;align-items:center;gap:6px;padding:8px 16px;border-radius:8px;font-size:13px;font-weight:600;cursor:pointer;transition:all 0.15s;border:none;text-decoration:none;}
    
	@keyframes newsSpin{to{transform:rotate(360deg);}}
	
.reply-hover-btn{position:absolute;top:4px;right:4px;opacity:0;transition:opacity 0.15s;background:rgba(255,255,255,0.9);border:none;border-radius:50%;width:26px;height:26px;font-size:13px;cursor:pointer;display:flex;align-items:center;justify-content:center;z-index:2;box-shadow:0 1px 3px rgba(0,0,0,0.1);}
.msg-row:hover .reply-hover-btn{opacity:0.7;}
.reply-hover-btn:hover{opacity:1!important;background:white;box-shadow:0 1px 5px rgba(0,0,0,0.15);}
.msg-hover-toolbar{position:absolute;top:4px;right:4px;opacity:0;transition:opacity 0.15s;display:flex;gap:2px;z-index:2;}
.msg-row:hover .msg-hover-toolbar{opacity:0.7;}
.msg-hover-toolbar:hover{opacity:1!important;}
.msg-hover-btn{background:rgba(255,255,255,0.9);border:none;border-radius:50%;width:26px;height:26px;font-size:13px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 1px 3px rgba(0,0,0,0.1);transition:all 0.15s;}
.msg-hover-btn:hover{background:white;box-shadow:0 1px 5px rgba(0,0,0,0.15);}
.msg-hover-btn.recall:hover{background:#fef2f2;color:#dc2626;}
.msg-hover-btn.edit:hover{background:#eff6ff;color:#2563eb;}
.msg-edit-wrap{margin-top:6px;display:flex;flex-direction:column;gap:4px;}
.msg-edit-wrap textarea{width:100%;min-width:200px;padding:6px 8px;border:1.5px solid #3b82f6;border-radius:8px;font-size:13px;font-family:inherit;resize:vertical;outline:none;min-height:40px;max-height:160px;}
.msg-edit-wrap textarea:focus{box-shadow:0 0 0 3px rgba(59,130,246,0.15);}
.msg-edit-actions{display:flex;gap:4px;justify-content:flex-end;}
.msg-edit-actions button{padding:4px 12px;border:none;border-radius:6px;font-size:11px;font-weight:600;cursor:pointer;font-family:inherit;transition:all 0.15s;}
.msg-edit-actions .edit-save{background:#3b82f6;color:#fff;}.msg-edit-actions .edit-save:hover{background:#2563eb;}
.msg-edit-actions .edit-cancel{background:#f3f4f6;color:#6b7280;}.msg-edit-actions .edit-cancel:hover{background:#e5e7eb;}
.msg-edited-tag{font-size:9px;color:#9ca3af;font-style:italic;margin-left:4px;}

.reply-quote{background:rgba(0,0,0,0.05);border-left:3px solid #25D366;border-radius:0 6px 6px 0;padding:5px 8px;margin-bottom:4px;font-size:12px;max-width:100%;overflow:hidden;cursor:pointer;}
.reply-quote:hover{background:rgba(0,0,0,0.08);}
.reply-quote .rq-text{color:#667781;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.reply-bar-wrap{background:#f0f2f5;border-top:1px solid #e5e7eb;padding:8px 12px;display:flex;align-items:center;gap:8px;}
.reply-bar-content{flex:1;background:white;border-left:4px solid #25D366;border-radius:0 8px 8px 0;padding:8px 12px;min-width:0;box-shadow:0 1px 2px rgba(0,0,0,0.05);}
.reply-bar-sender{font-size:12px;font-weight:700;color:#075E54;}
.reply-bar-text{font-size:13px;color:#667781;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px;}
	
	
	/* ===== Property Search Mode ===== */
#prop-results-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:16px;padding:4px;}
.prop-card{background:#fff;border-radius:12px;overflow:hidden;box-shadow:0 1px 4px rgba(0,0,0,0.06);border:1px solid #e5e7eb;transition:all 0.2s;display:flex;flex-direction:column;}
.prop-card:hover{box-shadow:0 6px 20px rgba(0,0,0,0.1);transform:translateY(-2px);}
.prop-photo-area{position:relative;height:160px;background:#f3f4f6;overflow:hidden;}
.prop-photo-area img{width:100%;height:100%;object-fit:cover;cursor:pointer;transition:transform 0.2s;}
.prop-photo-area img:hover{transform:scale(1.03);}
.prop-photo-count{position:absolute;bottom:8px;right:8px;background:rgba(0,0,0,0.7);color:#fff;font-size:10px;font-weight:600;padding:3px 8px;border-radius:12px;}
.prop-badge{position:absolute;top:8px;left:8px;padding:3px 8px;border-radius:4px;font-size:10px;font-weight:700;color:#fff;}
.prop-badge-new{background:#dc2626;}
.prop-badge-discount{background:#b8860b;}
.prop-body{padding:12px;flex:1;display:flex;flex-direction:column;}
.prop-title{font-size:14px;font-weight:700;color:#1a1a1a;line-height:1.3;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;margin-bottom:4px;}
.prop-location{font-size:12px;color:#717171;margin-bottom:8px;display:flex;align-items:center;gap:4px;}
.prop-stats{display:flex;gap:12px;margin-bottom:8px;}
.prop-stat{display:flex;align-items:center;gap:4px;font-size:11px;color:#525252;background:#f8f8f8;padding:4px 8px;border-radius:6px;}
.prop-price-row{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:4px;}
.prop-price{font-size:20px;font-weight:800;color:#dc2626;}
.prop-price .unit{font-size:13px;font-weight:600;color:#717171;margin-left:2px;}
.prop-sqft{font-size:11px;color:#a0a0a0;}
.prop-original{font-size:11px;color:#a0a0a0;text-decoration:line-through;margin-right:6px;}
.prop-discount-tag{font-size:10px;font-weight:700;color:#dc2626;background:#fef2f2;padding:2px 6px;border-radius:4px;}
.prop-footer{display:flex;align-items:center;justify-content:space-between;font-size:11px;color:#a0a0a0;padding-top:8px;margin-top:auto;border-top:1px solid #f0f0f0;}
.prop-actions{display:flex;gap:6px;margin-top:8px;}
.prop-btn{flex:1;padding:7px 4px;text-align:center;font-size:11px;font-weight:600;border-radius:8px;cursor:pointer;transition:all 0.15s;border:none;font-family:inherit;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:3px;white-space:nowrap;line-height:1.2;}
.prop-btn-detail{background:#fff;border:1.5px solid #dc2626;color:#dc2626;}.prop-btn-detail:hover{background:#dc2626;color:#fff;}
.prop-btn-share{background:#25D366;color:#fff;}.prop-btn-share:hover{background:#22c55e;}
.prop-loading{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;color:#a0a0a0;font-size:12px;gap:8px;}
.prop-spinner{width:24px;height:24px;border:3px solid #e5e7eb;border-top-color:#dc2626;border-radius:50%;animation:spin 0.8s linear infinite;}
@keyframes spin{to{transform:rotate(360deg);}}
.prop-empty{text-align:center;padding:60px 20px;color:#a0a0a0;}
.prop-sidebar-item{cursor:pointer;transition:background 0.15s;padding:10px 12px;border-bottom:1px solid #f0f0f0;}
.prop-sidebar-item:hover{background:#f8f8f8;}
.prop-sidebar-item.active{background:#fef2f2;}
@media(max-width:768px){#prop-results-grid{grid-template-columns:1fr;}.prop-photo-area{height:140px;}}

/* ===== Property Lightbox ===== */
.prop-lightbox{display:none;position:fixed;inset:0;background:rgba(0,0,0,.95);z-index:2000;flex-direction:column;}
.prop-lightbox.active{display:flex;}
.prop-lb-header{flex-shrink:0;display:flex;justify-content:space-between;align-items:center;padding:16px 24px;background:rgba(0,0,0,.5);}
.prop-lb-counter{color:rgba(255,255,255,.7);font-size:14px;}.prop-lb-counter span{color:#fff;font-weight:700;}
.prop-lb-close{width:44px;height:44px;background:rgba(255,255,255,.1);border:none;border-radius:8px;color:#fff;font-size:24px;cursor:pointer;transition:.25s;}
.prop-lb-close:hover{background:rgba(255,255,255,.2);}
.prop-lb-main{flex:1;display:flex;align-items:center;justify-content:center;position:relative;padding:20px 60px;min-height:0;overflow:hidden;}
.prop-lb-image{max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;border-radius:8px;transition:opacity .2s;}
.prop-lb-nav{position:absolute;top:50%;transform:translateY(-50%);width:48px;height:48px;background:rgba(255,255,255,.1);border:none;border-radius:50%;color:#fff;font-size:24px;cursor:pointer;transition:.25s;z-index:10;}
.prop-lb-nav:hover{background:#dc2626;}
.prop-lb-prev{left:12px;}.prop-lb-next{right:12px;}
.prop-lb-footer{flex-shrink:0;padding:12px 24px;background:rgba(0,0,0,.5);}
.prop-lb-thumbs{display:flex;gap:8px;justify-content:center;overflow-x:auto;padding:4px 0;}
.prop-lb-thumb{width:64px;height:48px;border-radius:6px;overflow:hidden;cursor:pointer;opacity:.4;transition:.25s;flex-shrink:0;border:2px solid transparent;}
.prop-lb-thumb:hover{opacity:.8;}
.prop-lb-thumb.active{opacity:1;border-color:#dc2626;}
.prop-lb-thumb img{width:100%;height:100%;object-fit:cover;}

/* Property card thumbnails */
.prop-thumb-strip{display:flex;gap:3px;padding:5px 6px;background:linear-gradient(to top,rgba(0,0,0,.65),transparent);position:absolute;bottom:0;left:0;right:0;overflow-x:auto;}
.prop-thumb-item{width:42px;height:32px;border-radius:4px;overflow:hidden;cursor:pointer;opacity:.65;transition:.2s;border:1.5px solid transparent;flex-shrink:0;}
.prop-thumb-item:hover,.prop-thumb-item.active{opacity:1;}
.prop-thumb-item.active{border-color:#dc2626;}
.prop-thumb-item img{width:100%;height:100%;object-fit:cover;}

/* Credibility score badge */
.prop-score{position:absolute;top:8px;right:8px;min-width:46px;height:46px;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#fff;text-align:center;z-index:6;backdrop-filter:blur(8px);border:2.5px solid rgba(255,255,255,.35);box-shadow:0 2px 10px rgba(0,0,0,.25);transition:opacity .3s;}
.prop-score.excellent{background:linear-gradient(135deg,#10B981,#059669);}
.prop-score.good{background:linear-gradient(135deg,#3B82F6,#1D4ED8);}
.prop-score.fair{background:linear-gradient(135deg,#F59E0B,#D97706);}
.prop-score.poor{background:linear-gradient(135deg,#EF4444,#DC2626);}
.prop-score .ps-num{font-size:15px;font-weight:800;line-height:1;}
.prop-score .ps-lbl{font-size:8px;font-weight:600;letter-spacing:.3px;margin-top:1px;opacity:.9;}
@media(max-width:768px){.prop-lb-main{padding:10px;}.prop-lb-nav{width:36px;height:36px;font-size:18px;}.prop-lb-prev{left:4px;}.prop-lb-next{right:4px;}}


/* ===== 標籤篩選分組 ===== */
.tag-filter-section {
    margin: 8px 0;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fafafa;
}

.tag-filter-group {
    border-bottom: 1px solid #eee;
}
.tag-filter-group:last-child {
    border-bottom: none;
}

/* 類別標題 */
.tag-filter-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    background: #f5f5f5;
    user-select: none;
    transition: background 0.2s;
}
.tag-filter-group-header:hover {
    background: #eeeeee;
}
.tag-filter-group-header .toggle-icon {
    font-size: 12px;
    transition: transform 0.2s;
    color: #999;
}
.tag-filter-group.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* 標籤容器 */
.tag-filter-group-body {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    max-height: 200px;
    overflow-y: auto;
    transition: all 0.3s ease;
}
.tag-filter-group.collapsed .tag-filter-group-body {
    display: none;
}

/* 標籤 pill */
.tag-filter-group-body .filter-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    cursor: pointer;
    border: 1px solid #ddd;
    background: #fff;
    color: #555;
    transition: all 0.2s;
    white-space: nowrap;
}
.tag-filter-group-body .filter-tag:hover {
    border-color: #4caf50;
    color: #4caf50;
}
.tag-filter-group-body .filter-tag.active {
    background: #4caf50;
    color: #fff;
    border-color: #4caf50;
}
.tag-filter-group-body .filter-tag.empty {
    opacity: 0.4;
    cursor: default;
}
.tag-filter-group-body .filter-tag .tag-count {
    margin-left: 4px;
    font-size: 11px;
    opacity: 0.75;
}

/* 階段專用顏色 (active 狀態) */
.filter-tag.active[data-value="新客"]   { background: #4caf50; }
.filter-tag.active[data-value="跟進中"] { background: #ff9800; }
.filter-tag.active[data-value="已睇樓"] { background: #2196f3; }
.filter-tag.active[data-value="議價中"] { background: #e91e63; }
.filter-tag.active[data-value="已成交"] { background: #8bc34a; }
.filter-tag.active[data-value="已流失"] { background: #9e9e9e; }

/* 搜尋框 (用於標籤多嘅類別) */
.tag-filter-search {
    width: 100%;
    padding: 4px 8px;
    margin-bottom: 6px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
}
.tag-filter-search:focus {
    border-color: #4caf50;
}

/* Property Share Photo Picker */
.prop-share-photo-item{position:relative;width:72px;height:54px;border-radius:6px;overflow:hidden;cursor:pointer;flex-shrink:0;border:2.5px solid #e5e7eb;transition:all 0.15s;}
.prop-share-photo-item:hover{border-color:#86efac;}
.prop-share-photo-item.selected{border-color:#22c55e;box-shadow:0 0 0 2px rgba(34,197,94,0.25);}
.prop-share-photo-item img{width:100%;height:100%;object-fit:cover;}
.prop-share-photo-check{position:absolute;top:2px;right:2px;width:18px;height:18px;background:#22c55e;border-radius:50%;color:#fff;font-size:11px;display:flex;align-items:center;justify-content:center;opacity:0;transition:opacity 0.15s;box-shadow:0 1px 3px rgba(0,0,0,0.2);}
.prop-share-photo-item.selected .prop-share-photo-check{opacity:1;}
.prop-share-photo-idx{position:absolute;bottom:2px;left:2px;background:rgba(0,0,0,0.6);color:#fff;font-size:9px;padding:1px 4px;border-radius:4px;font-weight:700;}

/* ===== Mortgage Calculator Mode ===== */
.mort-input{margin-bottom:10px;}
.mort-input label{display:block;font-size:11px;font-weight:600;color:#6b7280;margin-bottom:3px;}
.mort-input input,.mort-input select{width:100%;padding:7px 10px;border:1.5px solid #e5e7eb;border-radius:8px;font-size:13px;font-weight:600;font-family:inherit;outline:none;transition:.2s;}
.mort-input input:focus,.mort-input select:focus{border-color:#C41E3A;box-shadow:0 0 0 3px rgba(196,30,58,0.1);}
.mort-input .mort-row{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.mort-input .mort-hint{font-size:10px;color:#a0a0a0;margin-top:2px;}
.mort-input .mort-prefix{position:relative;}
.mort-input .mort-prefix span{position:absolute;left:10px;top:50%;transform:translateY(-50%);font-size:12px;color:#C41E3A;font-weight:700;pointer-events:none;}
.mort-input .mort-prefix input{padding-left:24px;}
.mort-input .mort-suffix{position:relative;}
.mort-input .mort-suffix span{position:absolute;right:10px;top:50%;transform:translateY(-50%);font-size:11px;color:#9ca3af;font-weight:500;pointer-events:none;}
.mort-input .mort-suffix input{padding-right:32px;}
.mort-toggle-extra{width:100%;padding:8px;font-size:12px;font-weight:600;color:#6b7280;background:#f9fafb;border:1.5px solid #e5e7eb;border-radius:8px;cursor:pointer;transition:.2s;font-family:inherit;text-align:center;}
.mort-toggle-extra:hover{background:#f3f4f6;border-color:#d1d5db;}
.mort-extra-wrap{max-height:0;overflow:hidden;transition:max-height .35s ease;}
.mort-extra-wrap.open{max-height:500px;}
.mort-ins-info{margin-top:4px;padding:6px 10px;background:#fef3c7;border-left:3px solid #f59e0b;border-radius:4px;font-size:10px;color:#92400e;display:none;}
.mort-ins-info:not(:empty){display:block;}

/* ===== Customer Files Section ===== */
.cf-grid{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;}
.cf-item{position:relative;width:90px;height:72px;border-radius:8px;overflow:hidden;border:1.5px solid #e5e7eb;background:#f9fafb;cursor:pointer;transition:0.15s;}
.cf-item:hover{border-color:#22c55e;box-shadow:0 2px 8px rgba(0,0,0,0.1);transform:scale(1.03);}
.cf-item img{width:100%;height:100%;object-fit:cover;}
.cf-item .cf-remove{position:absolute;top:2px;right:2px;width:18px;height:18px;background:rgba(239,68,68,0.9);color:#fff;border:none;border-radius:50%;font-size:11px;cursor:pointer;display:none;align-items:center;justify-content:center;line-height:1;z-index:2;}
.cf-item:hover .cf-remove{display:flex;}
.cf-item .cf-time{position:absolute;top:2px;left:2px;background:rgba(0,0,0,0.5);color:#fff;font-size:7px;padding:1px 4px;border-radius:4px;}
.cf-item .cf-name{position:absolute;bottom:0;left:0;right:0;background:rgba(0,0,0,0.6);color:#fff;font-size:8px;padding:2px 4px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.cf-upload-btn{width:90px;height:72px;border:2px dashed #d1d5db;border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;transition:0.15s;background:#fafafa;color:#9ca3af;font-size:10px;gap:2px;}
.cf-upload-btn:hover{border-color:#86efac;background:#f0fdf4;color:#059669;}
.cf-upload-btn .cf-upload-icon{font-size:20px;}
.cf-doc-row{display:flex;align-items:center;gap:8px;padding:6px 8px;border-radius:8px;transition:0.15s;border:1px solid #f3f4f6;margin-top:4px;}
.cf-doc-row:hover{background:#f9fafb;border-color:#e5e7eb;}

/* ===== Profile Picture Lightbox ===== */
.pfp-lightbox{display:none;position:fixed;inset:0;background:rgba(0,0,0,.88);z-index:3000;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;backdrop-filter:blur(8px);}
.pfp-lightbox.active{display:flex;}
.pfp-lightbox .pfp-close{position:absolute;top:16px;right:20px;width:44px;height:44px;background:rgba(255,255,255,.1);border:none;border-radius:50%;color:#fff;font-size:22px;cursor:pointer;transition:.2s;z-index:1;}
.pfp-lightbox .pfp-close:hover{background:rgba(255,255,255,.25);}
.pfp-lightbox .pfp-img-wrap{position:relative;transition:transform .3s ease;}
.pfp-lightbox .pfp-img-wrap img{max-width:min(85vw,400px);max-height:min(85vh,400px);border-radius:50%;object-fit:cover;box-shadow:0 8px 40px rgba(0,0,0,.5);border:4px solid rgba(255,255,255,.15);}
.pfp-lightbox .pfp-name-bar{margin-top:20px;text-align:center;}
.pfp-lightbox .pfp-name-bar .pfp-name{color:#fff;font-size:20px;font-weight:700;text-shadow:0 2px 8px rgba(0,0,0,.4);}
.pfp-lightbox .pfp-name-bar .pfp-phone{color:rgba(255,255,255,.6);font-size:13px;margin-top:4px;}
.pfp-lightbox .pfp-fallback{width:200px;height:200px;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:72px;font-weight:800;color:#fff;box-shadow:0 8px 40px rgba(0,0,0,.5);border:4px solid rgba(255,255,255,.15);}


#chat-area { min-height: 0; }
#news-detail-view { min-height: 0; }
#news-detail-content { -webkit-overflow-scrolling: touch; }

/* ===== Quick Reply Manager ===== */
.qr-item{display:flex;align-items:center;gap:8px;padding:8px 10px;border:1px solid #e5e7eb;border-radius:10px;margin-bottom:6px;background:#fff;transition:all 0.15s;cursor:grab;}
.qr-item:hover{border-color:#86efac;box-shadow:0 1px 4px rgba(0,0,0,0.06);}
.qr-item.dragging{opacity:0.5;border-style:dashed;}
.qr-item .qr-handle{color:#d1d5db;font-size:16px;cursor:grab;flex-shrink:0;user-select:none;}
.qr-item .qr-text{flex:1;min-width:0;font-size:13px;color:#374151;word-break:break-word;}
.qr-item .qr-actions{display:flex;gap:2px;flex-shrink:0;}
.qr-item .qr-btn{width:28px;height:28px;border:none;border-radius:6px;cursor:pointer;font-size:13px;display:flex;align-items:center;justify-content:center;transition:0.15s;background:#f9fafb;color:#6b7280;}
.qr-item .qr-btn:hover{background:#f3f4f6;}
.qr-item .qr-btn.danger:hover{background:#fef2f2;color:#dc2626;}
.qr-add-area{margin-top:10px;}
.qr-add-area textarea{width:100%;padding:8px 10px;border:1.5px solid #e5e7eb;border-radius:10px;font-size:13px;font-family:inherit;resize:vertical;min-height:40px;max-height:120px;outline:none;transition:0.2s;}
.qr-add-area textarea:focus{border-color:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,0.1);}
.qr-add-actions{display:flex;gap:6px;margin-top:6px;justify-content:flex-end;}
.qr-add-actions button{padding:6px 14px;border:none;border-radius:8px;font-size:12px;font-weight:600;cursor:pointer;font-family:inherit;transition:0.15s;}
.qr-save-btn{background:#22c55e;color:#fff;}.qr-save-btn:hover{background:#16a34a;}
.qr-cancel-btn{background:#f3f4f6;color:#6b7280;}.qr-cancel-btn:hover{background:#e5e7eb;}

/* Result */
.mort-share-modal {
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.mort-result-wrap{max-width:800px;margin:0 auto;padding:20px;}
.mort-rv-hero{background:linear-gradient(135deg,#C41E3A 0%,#9B1B30 60%,#7a1526 100%);padding:28px 24px;border-radius:14px;text-align:center;color:#fff;position:relative;overflow:hidden;margin-bottom:20px;}
.mort-rv-hero::before{content:'';position:absolute;top:-60%;right:-20%;width:300px;height:300px;background:radial-gradient(circle,rgba(255,215,0,.12) 0%,transparent 70%);border-radius:50%;pointer-events:none;}
.mort-rv-hero .sub{font-size:12px;opacity:.7;position:relative;}
.mort-rv-hero .label{font-size:13px;opacity:.75;margin-top:10px;position:relative;}
.mort-rv-hero .val{font-size:40px;font-weight:800;letter-spacing:-1px;text-shadow:0 2px 8px rgba(0,0,0,.15);position:relative;}
.mort-rv-hero .badges{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:14px;position:relative;}
.mort-rv-hero .badge{display:inline-flex;align-items:center;gap:4px;padding:5px 14px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.15);border-radius:100px;font-size:12px;font-weight:600;backdrop-filter:blur(4px);}
.mort-rv-card{background:#fff;border-radius:14px;box-shadow:0 2px 12px rgba(0,0,0,.06);border:1px solid #e5e7eb;padding:24px;margin-bottom:16px;}
.mort-rv-card h3{font-size:15px;font-weight:700;color:#1f2937;margin-bottom:16px;display:flex;align-items:center;gap:6px;}
.mort-chart-row{display:grid;grid-template-columns:200px 1fr;gap:20px;align-items:start;}
.mort-donut-wrap{position:relative;width:160px;height:160px;margin:0 auto;}
.mort-donut-center{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;}
.mort-donut-center .lbl{font-size:10px;color:#9ca3af;font-weight:500;}
.mort-donut-center .vl{font-size:15px;font-weight:800;color:#1f2937;}
.mort-legend{display:flex;gap:16px;justify-content:center;margin-top:10px;}
.mort-legend span{display:flex;align-items:center;gap:5px;font-size:12px;color:#6b7280;font-weight:500;}
.mort-legend .dot{width:9px;height:9px;border-radius:50%;}
.mort-metrics{display:grid;grid-template-columns:1fr 1fr;gap:8px;}
.mort-metric{background:#f9fafb;border-radius:10px;padding:14px;border:1px solid #f3f4f6;}
.mort-metric .ml{font-size:10px;color:#9ca3af;font-weight:600;text-transform:uppercase;letter-spacing:.3px;margin-bottom:4px;}
.mort-metric .mv{font-size:16px;font-weight:700;color:#1f2937;}
.mort-cost-head{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:12px;flex-wrap:wrap;gap:6px;}
.mort-cost-label{font-size:15px;font-weight:700;color:#1f2937;}
.mort-cost-total{font-size:22px;font-weight:800;color:#C41E3A;}
.mort-cost-bar{height:20px;border-radius:10px;overflow:hidden;display:flex;margin-bottom:16px;background:#f3f4f6;}
.mort-cost-bar div{height:100%;min-width:2px;transition:width .5s ease;}
.mort-cost-list{display:flex;flex-direction:column;gap:4px;}
.mort-cost-row{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:6px;transition:.2s;}
.mort-cost-row:hover{background:#f9fafb;}
.mort-cost-row .cd{width:9px;height:9px;border-radius:3px;flex-shrink:0;}
.mort-cost-row .cn{flex:1;font-size:13px;color:#6b7280;font-weight:500;}
.mort-cost-row .cv{font-size:13px;font-weight:700;color:#1f2937;}
.mort-cost-row .cp{font-size:11px;color:#d1d5db;font-weight:600;min-width:36px;text-align:right;}
.mort-actions{display:flex;gap:10px;margin-top:16px;}
.mort-action-btn{flex:1;display:flex;align-items:center;justify-content:center;gap:6px;padding:12px;border:none;border-radius:10px;font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;transition:all .15s;}
.mort-action-btn:hover{transform:translateY(-1px);}
.mort-action-btn.copy{background:#fff;border:2px solid #C41E3A;color:#C41E3A;}
.mort-action-btn.copy:hover{background:#C41E3A;color:#fff;}
.mort-action-btn.share{background:linear-gradient(135deg,#25D366,#128C7E);color:#fff;border:none;}
.mort-action-btn.share:hover{opacity:.9;}
.mort-schedule-toggle{width:100%;padding:10px;font-size:12px;font-weight:600;color:#6b7280;background:#f9fafb;border:1.5px solid #e5e7eb;border-radius:10px;cursor:pointer;transition:.2s;font-family:inherit;text-align:center;margin-top:8px;}
.mort-schedule-wrap{max-height:0;overflow:hidden;transition:max-height .4s ease;}
.mort-schedule-wrap.open{max-height:500px;overflow-y:auto;}
.mort-sched-table{width:100%;border-collapse:collapse;font-size:11px;margin-top:12px;}
.mort-sched-table th,.mort-sched-table td{padding:8px 6px;text-align:right;border-bottom:1px solid #f3f4f6;}
.mort-sched-table th{background:#f9fafb;font-weight:600;color:#6b7280;position:sticky;top:0;}
.mort-sched-table .yr{background:#fff5f6;font-weight:600;}
.mort-ins-note{background:linear-gradient(135deg,#FEF3C7,#FFFBEB);border:1px solid #FDE68A;border-radius:10px;padding:12px 14px;margin-bottom:14px;}
.mort-ins-note .it{font-size:11px;font-weight:700;color:#92400E;margin-bottom:6px;display:flex;align-items:center;gap:4px;}
.mort-ins-note .ir{display:flex;justify-content:space-between;font-size:11px;color:#A16207;padding:2px 0;font-weight:500;}
.mort-ins-note .ir span:last-child{font-weight:700;}
@media(max-width:768px){
    .mort-chart-row{grid-template-columns:1fr;}
    .mort-metrics{grid-template-columns:1fr 1fr;gap:6px;}
    .mort-rv-hero .val{font-size:32px;}
    .mort-cost-total{font-size:18px;}
    .mort-result-wrap{padding:12px;}
}


/* ===== Group Property Panel ===== */
.gp-field-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:14px;margin-bottom:10px;transition:all 0.15s;}
.gp-field-card:hover{border-color:#d1d5db;box-shadow:0 1px 4px rgba(0,0,0,0.04);}
.gp-field-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px;}
.gp-field-label{font-size:11px;color:#9ca3af;font-weight:600;text-transform:uppercase;letter-spacing:0.3px;}
.gp-field-actions{display:flex;gap:4px;}
.gp-field-btn{font-size:11px;color:#059669;cursor:pointer;background:none;border:none;font-family:inherit;padding:2px 6px;border-radius:4px;transition:0.15s;}
.gp-field-btn:hover{background:#f0fdf4;color:#047857;}
.gp-field-btn.danger{color:#dc2626;}.gp-field-btn.danger:hover{background:#fef2f2;}
.gp-field-value{font-size:13px;color:#1f2937;line-height:1.5;}
.gp-field-empty{font-size:13px;color:#d1d5db;}
.gp-field-tag{display:inline-flex;align-items:center;gap:3px;padding:3px 10px;border-radius:9999px;font-size:12px;font-weight:500;margin:2px;cursor:default;}
.gp-auto-badge{display:inline-flex;align-items:center;gap:3px;padding:2px 8px;border-radius:9999px;font-size:10px;font-weight:600;background:#fef3c7;color:#92400e;border:1px solid #fde68a;cursor:pointer;transition:all 0.15s;}
.gp-auto-badge:hover{background:#fde68a;border-color:#f59e0b;}
.gp-auto-badge .gp-accept{color:#059669;font-weight:800;margin-left:2px;}
.gp-auto-badge .gp-reject{color:#dc2626;margin-left:1px;}

/* ===== Other Photos Grid ===== */
.gp-other-grid{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px;}
.gp-other-item{position:relative;width:100px;height:80px;border-radius:8px;overflow:hidden;border:1.5px solid #e5e7eb;background:#f9fafb;cursor:pointer;transition:0.15s;}
.gp-other-item:hover{border-color:#7c3aed;box-shadow:0 2px 8px rgba(0,0,0,0.1);transform:scale(1.03);}
.gp-other-item img{width:100%;height:100%;object-fit:cover;}
.gp-other-item .gp-other-sender{position:absolute;bottom:0;left:0;right:0;background:rgba(0,0,0,0.6);color:#fff;font-size:8px;padding:2px 4px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.gp-other-item .gp-other-time{position:absolute;top:2px;right:2px;background:rgba(0,0,0,0.5);color:#fff;font-size:7px;padding:1px 4px;border-radius:4px;}

.gp-file-date {
    font-size: 10px;
    color: #999;
    text-align: center;
    line-height: 1.2;
}
.gp-file-entry-time {
    font-size: 11px;
    color: #aaa;
    margin-left: 6px;
    white-space: nowrap;
}

/* File Grid */
.gp-file-grid{display:flex;flex-wrap:wrap;gap:8px;margin-top:6px;}
.gp-file-item{position:relative;width:80px;height:64px;border-radius:8px;overflow:hidden;border:1.5px solid #e5e7eb;background:#f9fafb;cursor:pointer;transition:0.15s;}
.gp-file-item:hover{border-color:#86efac;box-shadow:0 2px 8px rgba(0,0,0,0.08);}
.gp-file-item img{width:100%;height:100%;object-fit:cover;}
.gp-file-item .gp-file-icon{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:28px;background:#f3f4f6;}
.gp-file-item .gp-file-remove{position:absolute;top:2px;right:2px;width:18px;height:18px;background:rgba(239,68,68,0.9);color:#fff;border:none;border-radius:50%;font-size:11px;cursor:pointer;display:none;align-items:center;justify-content:center;line-height:1;}
.gp-file-item:hover .gp-file-remove{display:flex;}
.gp-file-item .gp-file-name{position:absolute;bottom:0;left:0;right:0;background:rgba(0,0,0,0.6);color:#fff;font-size:8px;padding:2px 4px;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.gp-upload-btn{width:80px;height:64px;border:2px dashed #d1d5db;border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;transition:0.15s;background:#fafafa;color:#9ca3af;font-size:10px;gap:2px;}
.gp-upload-btn:hover{border-color:#86efac;background:#f0fdf4;color:#059669;}
.gp-upload-btn .gp-upload-icon{font-size:20px;}

/* VR Link */
.gp-vr-link{display:inline-flex;align-items:center;gap:6px;padding:6px 12px;background:linear-gradient(135deg,#eff6ff,#dbeafe);border:1px solid #bfdbfe;border-radius:8px;font-size:12px;color:#1d4ed8;text-decoration:none;transition:0.15s;max-width:100%;overflow:hidden;}
.gp-vr-link:hover{background:linear-gradient(135deg,#dbeafe,#bfdbfe);border-color:#93c5fd;}
.gp-vr-link .gp-vr-url{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;flex:1;min-width:0;}

/* Section divider */
.gp-section-title{font-size:12px;font-weight:700;color:#6b7280;padding:8px 0 4px;margin-top:6px;border-bottom:1px solid #f3f4f6;display:flex;align-items:center;gap:6px;}

/* Auto-detect summary bar */
.gp-auto-bar{background:linear-gradient(135deg,#fef3c7,#fde68a);border:1px solid #f59e0b;border-radius:10px;padding:10px 14px;margin-bottom:12px;display:flex;align-items:center;justify-content:space-between;}
.gp-auto-bar .gp-auto-text{font-size:12px;color:#92400e;font-weight:600;}
.gp-auto-bar .gp-auto-actions{display:flex;gap:6px;}
.gp-auto-bar button{font-size:11px;padding:4px 10px;border-radius:6px;border:none;cursor:pointer;font-family:inherit;font-weight:600;transition:0.15s;}
.gp-auto-bar .gp-accept-all{background:#059669;color:#fff;}.gp-auto-bar .gp-accept-all:hover{background:#047857;}
.gp-auto-bar .gp-dismiss-all{background:#fff;color:#6b7280;border:1px solid #d1d5db;}.gp-auto-bar .gp-dismiss-all:hover{background:#f9fafb;}

/* Group property panel header */
.gp-panel-header{background:linear-gradient(135deg,#7c3aed,#6d28d9);color:#fff;}
.gp-prop-name-hero{text-align:center;padding:16px;background:linear-gradient(135deg,#8b5cf6,#7c3aed);border-radius:12px;margin-bottom:12px;}
.gp-prop-name-hero .gp-hero-name{font-size:18px;font-weight:800;color:#fff;}
.gp-prop-name-hero .gp-hero-sub{font-size:11px;color:rgba(255,255,255,0.7);margin-top:4px;}

/* Scan animation */
@keyframes gpScan{0%{opacity:0.5;}50%{opacity:1;}100%{opacity:0.5;}}
.gp-scanning{animation:gpScan 1.5s ease-in-out infinite;}


/* ===== Sticker Picker ===== */
#sticker-picker{display:none;background:#fff;border-top:1px solid #e5e7eb;max-height:260px;overflow:hidden;flex-direction:column;flex-shrink:0;}
#sticker-picker.open{display:flex;}
.sticker-tabs{display:flex;gap:0;overflow-x:auto;border-bottom:1px solid #f3f4f6;padding:0 8px;flex-shrink:0;scrollbar-width:none;}
.sticker-tabs::-webkit-scrollbar{display:none;}
.sticker-tab{padding:8px 12px;font-size:11px;font-weight:600;color:#9ca3af;cursor:pointer;border:none;border-bottom:2px solid transparent;white-space:nowrap;transition:all 0.15s;background:none;font-family:inherit;}
.sticker-tab:hover{color:#374151;}.sticker-tab.active{color:#059669;border-bottom-color:#059669;}
.sticker-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(72px,1fr));gap:8px;padding:10px;overflow-y:auto;flex:1;-webkit-overflow-scrolling:touch;}
.sticker-item{width:72px;height:72px;border-radius:10px;overflow:hidden;cursor:pointer;border:2px solid transparent;transition:all 0.15s;background:#f9fafb;display:flex;align-items:center;justify-content:center;position:relative;}
.sticker-item:hover{border-color:#86efac;transform:scale(1.08);box-shadow:0 2px 8px rgba(0,0,0,0.1);}
.sticker-item:active{transform:scale(0.95);}
.sticker-item img{max-width:100%;max-height:100%;object-fit:contain;}
.sticker-del{position:absolute;top:1px;right:1px;width:16px;height:16px;background:rgba(239,68,68,0.85);color:#fff;border:none;border-radius:50%;font-size:9px;cursor:pointer;align-items:center;justify-content:center;line-height:1;display:none;z-index:2;}
.sticker-item:hover .sticker-del{display:flex;}
.sticker-upload-item{width:72px;height:72px;border-radius:10px;border:2px dashed #d1d5db;cursor:pointer;display:flex;flex-direction:column;align-items:center;justify-content:center;color:#9ca3af;font-size:10px;gap:2px;transition:all 0.15s;background:#fafafa;}
.sticker-upload-item:hover{border-color:#86efac;background:#f0fdf4;color:#059669;}
.sticker-empty{grid-column:1/-1;text-align:center;padding:20px;color:#d1d5db;font-size:13px;}

/* ===== Lazy Image Placeholder ===== */
.pfp-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.pfp-placeholder.loaded { display: none; }

/* ===== Fix: 頭像 img + placeholder 用 Grid 重疊 ===== */
.pfp-wrap {
    display: grid;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    position: relative;  /* 畀 star badge 用 */
}
.pfp-wrap > img.pfp-lazy,
.pfp-wrap > .pfp-placeholder {
    grid-column: 1;
    grid-row: 1;        /* 同一格 = 自動重疊 */
    width: 40px;
    height: 40px;
}
.pfp-wrap > img.pfp-lazy {
    z-index: 1;          /* 相片喺 placeholder 上面 */
}

img.pfp-lazy {
    border-radius: 50%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.2s;
}
img.pfp-lazy.pfp-visible { opacity: 1; }
img.pfp-lazy.pfp-error { display: none !important; }

.pfp-placeholder {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
}
.pfp-placeholder.loaded { display: none; }

/* ===== Fix: Profile Pic 頭像重疊 ===== */
img.pfp-lazy {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s;
}
img.pfp-lazy.pfp-visible { 
    opacity: 1; 
}
img.pfp-lazy.pfp-error { 
    display: none !important; 
}

.pfp-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    color: #fff;
    flex-shrink: 0;
    /* placeholder 做「定位基準」，佔據空間 */
    position: relative;
}
.pfp-placeholder.loaded { 
    /* 圖片載入成功後，placeholder 保留空間但內容隱藏 */
    color: transparent;
}

/* ===== Virtual scroll sentinel ===== */
.scroll-sentinel { height: 1px; }

.tag-more{background:#e5e7eb!important;color:#6b7280!important;cursor:pointer;font-weight:600;}
.tag-more:hover{background:#d1d5db!important;}

.prop-ac-list{position:absolute;top:100%;left:0;right:0;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 4px 12px rgba(0,0,0,0.1);max-height:260px;overflow-y:auto;z-index:100;margin-top:2px;padding:0;list-style:none;display:none;}
.prop-ac-list.active{display:block;}
.prop-ac-item:hover{background:#f0f9ff!important;}



/* 樓盤名編輯時放寬 modal + 唔剪清單 */
#modal-body:has(#prop-ac-wrap){overflow:visible!important;max-height:none!important;}
#edit-modal>div:has(#prop-ac-wrap){overflow:visible!important;}
#prop-ac-wrap{position:relative;}
.prop-ac-list{z-index:300;}
#gp-edit-body:has(#gp-prop-ac-wrap){overflow:visible!important;max-height:none!important;}
#gp-edit-modal>div:has(#gp-prop-ac-wrap){overflow:visible!important;}
#gp-prop-ac-wrap{position:relative;}


.prop-keyword-ac{position:absolute;top:calc(100% + 4px);left:0;right:0;background:#fff;border:1px solid #e5e7eb;border-radius:8px;box-shadow:0 8px 24px rgba(0,0,0,.12);list-style:none;margin:0;padding:4px;z-index:2000;max-height:280px;overflow-y:auto;display:none;}
.prop-keyword-ac.active{display:block;}
.prop-keyword-ac-item{display:flex;align-items:center;gap:8px;padding:8px 10px;border-radius:6px;cursor:pointer;transition:background .12s;}
.prop-keyword-ac-item:hover,.prop-keyword-ac-item.hl{background:#fef2f2;}
.prop-keyword-ac-icon{width:28px;height:28px;flex-shrink:0;display:flex;align-items:center;justify-content:center;background:#fef2f2;border-radius:6px;font-size:14px;}
.prop-keyword-ac-txt{min-width:0;flex:1;}
.prop-keyword-ac-name{font-size:13px;font-weight:700;color:#1f2937;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.prop-keyword-ac-name mark{background:transparent;color:#dc2626;font-weight:800;}
.prop-keyword-ac-loc{font-size:11px;color:#9ca3af;margin-top:1px;}
.prop-keyword-ac-empty{padding:12px;text-align:center;color:#9ca3af;font-size:12px;}

/* 📍 地區 Cascade Picker（網站風格）*/
.lp-region{margin-bottom:24px;}
.lp-region:last-child{margin-bottom:0;}
.lp-region-head{display:flex;align-items:center;gap:10px;margin-bottom:12px;cursor:pointer;user-select:none;}
.lp-region-name{font-size:15px;font-weight:700;color:#111827;flex:1;display:flex;align-items:center;gap:6px;}
.lp-region-body{display:none;}
.lp-region.open .lp-region-body{display:block;}
.lp-region.open > .lp-region-head .lp-arrow{transform:rotate(180deg);color:#C41E3A;}
.lp-arrow{width:16px;height:16px;color:#B5BAC4;transition:transform .3s;flex-shrink:0;}

.lp-acc{border:1px solid #EAEBEE;border-radius:12px;margin-bottom:10px;overflow:hidden;transition:border-color .2s;}
.lp-acc:last-child{margin-bottom:0;}
.lp-acc.open{border-color:#C41E3A;}
.lp-acc-head{display:flex;align-items:center;gap:10px;padding:14px 16px;cursor:pointer;background:#fff;transition:.2s;user-select:none;}
.lp-acc-head:hover{background:#FAFAFA;}
.lp-acc.open .lp-acc-head{background:#FFF0F3;}
.lp-count{font-size:12px;color:#B5BAC4;}
.lp-acc-body{max-height:0;overflow:hidden;transition:max-height .3s ease;}
.lp-acc.open .lp-acc-body{max-height:1200px;padding:16px;border-top:1px solid #F4F5F7;}
.lp-chips{display:flex;flex-wrap:wrap;gap:8px;}
.lp-chip{display:inline-flex;align-items:center;padding:8px 14px;border:1.5px solid #EAEBEE;border-radius:100px;background:#fff;font-size:13px;font-weight:500;color:#697080;cursor:pointer;transition:.2s;white-space:nowrap;}
.lp-chip:hover{border-color:#DDE0E5;background:#FAFAFA;}
.lp-chip.on{background:#FFF0F3;border-color:#C41E3A;color:#C41E3A;}
.lp-whole{margin-left:auto;font-weight:600;}
.lp-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 6px;font-size:11px;font-weight:700;color:#fff;background:#C41E3A;border-radius:100px;}

/* ===================== 暗黑模式 v3 ===================== */
:root{ --dk-bg:#0e1117; --dk-surface:#171a21; --dk-surface2:#1e222b; --dk-surface3:#262b35; --dk-border:#2c313c; --dk-text:#e4e6eb; --dk-text2:#9aa0aa; --dk-accent:#e0455f; --dk-accent-bg:#3a1a22; }

body.dark, body.dark #main-content{ background:var(--dk-bg) !important; color:var(--dk-text) !important; }
body, #main-content{ transition:background .25s ease, color .25s ease; }

/* 表面 / 卡 */
body.dark .bg-white{ background:var(--dk-surface) !important; color:var(--dk-text) !important; }
body.dark #sidebar{ background:var(--dk-surface) !important; border-color:var(--dk-border) !important; }
body.dark .bg-gray-50, body.dark .bg-gray-100{ background:var(--dk-surface2) !important; }
body.dark .bg-gray-200{ background:var(--dk-surface3) !important; }
body.dark .bg-blue-50, body.dark .bg-green-50, body.dark .bg-red-50, body.dark .bg-yellow-50, body.dark .bg-orange-50, body.dark .bg-purple-50, body.dark .bg-pink-50{ background:var(--dk-surface2) !important; }
body.dark .shadow, body.dark .shadow-sm, body.dark .shadow-md, body.dark .shadow-lg, body.dark .shadow-xl{ box-shadow:0 2px 8px rgba(0,0,0,.45) !important; }

/* 文字 */
body.dark .text-gray-900, body.dark .text-gray-800, body.dark .text-gray-700, body.dark .text-black{ color:var(--dk-text) !important; }
body.dark .text-gray-600, body.dark .text-gray-500, body.dark .text-gray-400, body.dark .text-gray-300{ color:var(--dk-text2) !important; }

/* 邊框 */
body.dark .border, body.dark .border-t, body.dark .border-b, body.dark .border-l, body.dark .border-r, body.dark .border-gray-200, body.dark .border-gray-100, body.dark .border-gray-300{ border-color:var(--dk-border) !important; }
body.dark .divide-y > * { border-color:var(--dk-border) !important; }

/* hover */
body.dark .hover\:bg-gray-50:hover, body.dark .hover\:bg-gray-100:hover, body.dark .hover\:bg-gray-200:hover{ background:var(--dk-surface3) !important; }

/* 頂 tab */
body.dark .mode-tab{ color:var(--dk-text2) !important; }
body.dark .mode-tab:hover{ background:var(--dk-surface3) !important; color:var(--dk-text) !important; }
body.dark .mode-tab.active-tab{ background:var(--dk-accent-bg) !important; color:#fff !important; }

/* chat */
body.dark .chat-bg{ background-color:#0b0f14 !important; }
body.dark .bubble-in{ background:#1f2c34 !important; color:var(--dk-text) !important; }
body.dark .bubble-out{ background:#134d37 !important; color:var(--dk-text) !important; }

/* 客戶列表 */
body.dark .customer-item:hover{ background:var(--dk-surface2) !important; }
body.dark .customer-item.active{ background:var(--dk-accent-bg) !important; }

/* chips / 掣 */
body.dark .filter-chip{ background:var(--dk-surface2) !important; color:var(--dk-text2) !important; border-color:var(--dk-border) !important; }
body.dark .filter-chip.active{ background:var(--dk-accent) !important; color:#fff !important; border-color:var(--dk-accent) !important; }
body.dark .quick-btn{ background:var(--dk-surface2) !important; color:var(--dk-text2) !important; border-color:var(--dk-border) !important; }
body.dark .chk-label{ color:var(--dk-text2) !important; }

/* input */
body.dark input, body.dark textarea, body.dark select{ background:var(--dk-surface3) !important; color:var(--dk-text) !important; border-color:#3a4150 !important; }
body.dark input::placeholder, body.dark textarea::placeholder{ color:#6b7280 !important; }
body.dark #msg-input-bar{ background:var(--dk-surface) !important; border-color:var(--dk-border) !important; }
body.dark .reply-bar-wrap{ background:var(--dk-surface) !important; border-color:var(--dk-border) !important; }
body.dark .reply-bar-content{ background:#1f2c34 !important; }

/* 樓盤 */
body.dark .prop-card{ background:var(--dk-surface) !important; border-color:var(--dk-border) !important; }
body.dark .prop-photo-area{ background:var(--dk-surface3) !important; }
body.dark .prop-title{ color:var(--dk-text) !important; }
body.dark .prop-stat{ background:var(--dk-surface3) !important; color:var(--dk-text2) !important; }
body.dark .prop-sidebar-item{ border-color:var(--dk-border) !important; }
body.dark .prop-sidebar-item:hover{ background:var(--dk-surface2) !important; }

/* 按揭 / 付款計劃 */
body.dark .mort-input label{ color:var(--dk-text2) !important; }
body.dark .mort-prefix, body.dark .mort-suffix{ background:var(--dk-surface3) !important; border-color:#3a4150 !important; }
body.dark .mort-rv-card{ background:var(--dk-surface) !important; border-color:var(--dk-border) !important; }
body.dark .mort-metric{ background:var(--dk-surface2) !important; }
body.dark .mort-sched-table th{ background:var(--dk-surface2) !important; color:var(--dk-text2) !important; }
body.dark .mort-sched-table td{ border-color:var(--dk-border) !important; }

/* modal */
body.dark .modal-box, body.dark [class*="rounded"][style*="background:#fff"]{ background:var(--dk-surface) !important; }

/* scrollbar */
body.dark ::-webkit-scrollbar-thumb{ background:#3a4150 !important; }
body.dark ::-webkit-scrollbar-track{ background:var(--dk-surface) !important; }

/* ── 蓋 inline 白底（modal / 卡用 style="background:#fff" 寫死）── */
body.dark [style*="background:#fff"],
body.dark [style*="background: #fff"],
body.dark [style*="background:#FFF"],
body.dark [style*="background:white"],
body.dark [style*="background-color:#fff"],
body.dark [style*="background-color: #fff"],
body.dark [style*="background:#ffffff"],
body.dark [style*="background:#FFFFFF"]{ background:var(--dk-surface) !important; color:var(--dk-text) !important; }

body.dark [style*="border-bottom:1px solid #eee"],
body.dark [style*="border-top:1px solid #eee"],
body.dark [style*="border:1px solid #eee"],
body.dark [style*="border:1px solid #ddd"],
body.dark [style*="border:1px solid #e"],
body.dark [style*="border:1px solid #f"]{ border-color:var(--dk-border) !important; }

body.dark [style*="color:#888"],
body.dark [style*="color:#999"],
body.dark [style*="color:#666"],
body.dark [style*="color:#333"],
body.dark [style*="color:#222"],
body.dark [style*="color:#1e293b"],
body.dark [style*="color:#334155"],
body.dark [style*="color:#64748b"]{ color:var(--dk-text) !important; }

body.dark [style*="background:#f8fafc"],
body.dark [style*="background:#f5f5f5"],
body.dark [style*="background:#f0"],
body.dark [style*="background:#F8FAFB"],
body.dark [style*="background:#fafafa"],
body.dark [style*="background:#eee"],
body.dark [style*="background:#f9"]{ background:var(--dk-surface2) !important; }

/* ── 按揭 / 付款計劃 卡數字要清晰（唔好變灰）── */
body.dark .mort-metric .mv{ color:var(--dk-text) !important; }
body.dark .mort-metric .ml{ color:var(--dk-text2) !important; }
body.dark .mort-rv-hero, body.dark .mort-rv-hero *{ color:#fff !important; }
body.dark .mort-cost-total, body.dark .mort-cost-label{ color:var(--dk-text) !important; }
body.dark .mort-cost-row .cn{ color:var(--dk-text2) !important; }
body.dark .mort-cost-row .cv{ color:var(--dk-text) !important; }
body.dark .mort-ins-note{ background:var(--dk-surface2) !important; }
body.dark .mort-ins-note *{ color:var(--dk-text) !important; }

/* payplan 時序卡 inline 深紅底文字保持白 */
body.dark [style*="linear-gradient(135deg,#C41E3A"], 
body.dark [style*="linear-gradient(135deg, #C41E3A"]{ color:#fff !important; }

/* ===== 暗黑模式 v3 補丁：按揭 / 付款計劃卡執靚 ===== */
/* 標題（貸款詳情）唔好有底色 */
body.dark .mort-rv-card h3{ background:transparent !important; color:var(--dk-text) !important; }

/* donut 中間文字要清 */
body.dark .mort-donut-center .lbl{ color:var(--dk-text2) !important; }
body.dark .mort-donut-center .vl{ color:var(--dk-text) !important; }
/* donut 灰底軌道太光 → 轉深 */
body.dark .mort-donut-wrap svg circle[stroke="#F0F0F0"]{ stroke:var(--dk-surface3) !important; }

/* 成本 bar 底 + hover + 百分比 */
body.dark .mort-cost-bar{ background:var(--dk-surface3) !important; }
body.dark .mort-cost-row:hover{ background:var(--dk-surface2) !important; }
body.dark .mort-cost-row .cp{ color:var(--dk-text2) !important; }

/* 供款表 年份行 */
body.dark .mort-sched-table .yr{ background:var(--dk-accent-bg) !important; }
body.dark .mort-sched-table td{ color:var(--dk-text) !important; }

/* 黃色提示框：柔和啲 */
body.dark .mort-ins-note{ background:var(--dk-surface2) !important; border-color:#4a3f1a !important; }
body.dark .mort-ins-note .it{ color:#f0c869 !important; }
body.dark .mort-ins-note .ir{ color:var(--dk-text2) !important; }

/* toggle / copy 掣 */
body.dark .mort-toggle-extra, body.dark .mort-schedule-toggle{ background:var(--dk-surface2) !important; color:var(--dk-text2) !important; border-color:var(--dk-border) !important; }
body.dark .mort-toggle-extra:hover, body.dark .mort-schedule-toggle:hover{ background:var(--dk-surface3) !important; }
body.dark .mort-action-btn.copy{ background:var(--dk-surface2) !important; }

/* mort input 框聚焦光暈保持紅但底變深 */
body.dark .mort-input input, body.dark .mort-input select{ background:var(--dk-surface3) !important; color:var(--dk-text) !important; border-color:#3a4150 !important; }

/* ins-info 黃提示（sidebar） */
body.dark .mort-ins-info{ background:var(--dk-surface2) !important; color:#f0c869 !important; border-left-color:#8a6d1a !important; }

/* 地區 picker 深色 */
body.dark .lp-region-name{ color:var(--dk-text) !important; }
body.dark .lp-acc{ border-color:var(--dk-border) !important; }
body.dark .lp-acc-head{ background:var(--dk-surface) !important; }
body.dark .lp-acc-head:hover{ background:var(--dk-surface2) !important; }
body.dark .lp-acc.open .lp-acc-head{ background:var(--dk-accent-bg) !important; }
body.dark .lp-acc.open .lp-acc-body{ border-top-color:var(--dk-border) !important; }
body.dark .lp-chip{ background:var(--dk-surface2) !important; border-color:var(--dk-border) !important; color:var(--dk-text2) !important; }
body.dark .lp-chip:hover{ background:var(--dk-surface3) !important; }
body.dark .lp-chip.on{ background:var(--dk-accent-bg) !important; border-color:var(--dk-accent) !important; color:#fff !important; }

/* 標籤篩選分組 */
body.dark .tag-filter-section{ background:var(--dk-surface) !important; border-color:var(--dk-border) !important; }
body.dark .tag-filter-group-header{ background:var(--dk-surface2) !important; color:var(--dk-text2) !important; }
body.dark .tag-filter-group-header:hover{ background:var(--dk-surface3) !important; }
body.dark .tag-filter-group-body .filter-tag{ background:var(--dk-surface2) !important; border-color:var(--dk-border) !important; color:var(--dk-text2) !important; }

/* 快速回覆 / sticker */
body.dark .qr-item{ background:var(--dk-surface) !important; border-color:var(--dk-border) !important; }
body.dark .qr-item .qr-text{ color:var(--dk-text) !important; }
body.dark .qr-item .qr-btn{ background:var(--dk-surface2) !important; color:var(--dk-text2) !important; }
body.dark #sticker-picker{ background:var(--dk-surface) !important; border-color:var(--dk-border) !important; }
body.dark .sticker-item{ background:var(--dk-surface2) !important; }

/* ===== 暗黑模式 v3 補丁 2：新聞覆核框 + autocomplete ===== */
/* 黃色覆核地區框（多數 inline 黃底）→ 轉深 */
body.dark [style*="background:#fef"],
body.dark [style*="background: #fef"],
body.dark [style*="background:#FEF"],
body.dark [style*="background:#fff7"],
body.dark [style*="background:#fffbe"],
body.dark [style*="background:#fefce8"],
body.dark [style*="linear-gradient(135deg,#fef3c7"],
body.dark [style*="linear-gradient(135deg, #fef3c7"],
body.dark [style*="linear-gradient(135deg,#feff7"]{ background:var(--dk-surface2) !important; }

body.dark .smart-filter-bar{ background:var(--dk-surface2) !important; border-color:var(--dk-border) !important; }

/* 樓盤 autocomplete 下拉 */
body.dark .prop-ac-list, body.dark .prop-keyword-ac{ background:var(--dk-surface) !important; border-color:var(--dk-border) !important; }
body.dark .prop-ac-item{ color:var(--dk-text) !important; }
body.dark .prop-ac-item:hover{ background:var(--dk-surface3) !important; }
body.dark .prop-keyword-ac-item:hover, body.dark .prop-keyword-ac-item.hl{ background:var(--dk-accent-bg) !important; }
body.dark .prop-keyword-ac-icon{ background:var(--dk-surface3) !important; }
body.dark .prop-keyword-ac-name{ color:var(--dk-text) !important; }
body.dark .prop-keyword-ac-name mark{ color:var(--dk-accent) !important; }
body.dark .prop-keyword-ac-loc{ color:var(--dk-text2) !important; }
body.dark .prop-keyword-ac-empty{ color:var(--dk-text2) !important; }

/* 新聞縮圖 / 分類 */
body.dark .news-thumb{ background:var(--dk-surface3) !important; }
body.dark .news-detail-body{ color:var(--dk-text) !important; }
body.dark .news-cat{ background:var(--dk-accent-bg) !important; color:#f0a0ac !important; }

/* 覆核框內灰字（大區/區域/細區） */
body.dark [style*="color:#9"], body.dark [style*="color:#a"], body.dark [style*="color:#b"]{ color:var(--dk-text2) !important; }

/* ===== 暗黑模式 v3 補丁 3：amber 系文字 ===== */
body.dark .bg-amber-50, body.dark .bg-amber-100{ background:var(--dk-surface2) !important; }
body.dark .text-amber-700, body.dark .text-amber-800, body.dark .text-amber-600, body.dark .text-amber-900{ color:#f0c869 !important; }
body.dark .border-amber-200, body.dark .border-amber-100{ border-color:#4a3f1a !important; }
/* 覆核框內容（大區/區域/細區/樓盤）text-gray-700 已蓋，確保清 */
body.dark #news-loc-display{ color:var(--dk-text) !important; }
body.dark #news-loc-display br + *, body.dark #news-loc-display{ color:var(--dk-text) !important; }

/* 綠 / 紅 / 藍系 pill 掣文字 */
body.dark .bg-green-100, body.dark .bg-green-50{ background:var(--dk-surface2) !important; }
body.dark .text-green-700, body.dark .text-green-800, body.dark .text-green-600{ color:#6ee7a8 !important; }
body.dark .bg-red-100{ background:var(--dk-surface2) !important; }
body.dark .text-red-700, body.dark .text-red-800{ color:#f0a0ac !important; }
body.dark .border-green-200{ border-color:#1e4d3a !important; }

/* ===== 暗黑模式 v3 補丁 4：付款計劃拆解框（#FBE8EB 粉紅底）===== */
body.dark [style*="#FBE8EB"],
body.dark [style*="#fbe8eb"],
body.dark [style*="background:#FBE8EB"],
body.dark [style*="background: #FBE8EB"]{ background:var(--dk-surface2) !important; }

/* 拆解框內灰字（成交價/已繳訂金/貸款額）睇清 */
body.dark [style*="#FBE8EB"] span,
body.dark [style*="#fbe8eb"] span,
body.dark [style*="#FBE8EB"] div,
body.dark [style*="#fbe8eb"] div{ color:var(--dk-text) !important; }

/* 拆解框分隔線 */
body.dark [style*="e2c9cf"]{ border-color:var(--dk-border) !important; }

/* 但「= 樓價餘額」同紅色數字保持深紅 accent */
body.dark [style*="#FBE8EB"] [style*="#C41E3A"],
body.dark [style*="#fbe8eb"] [style*="#C41E3A"]{ color:#f0a0ac !important; }