    :root {
      --yellow: #F59E0B;
      --amber: #F59E0B;
      --black: #0F1722;
      --navy: #0F1722;
      --white: #FFFFFF;
      --bg: #F5F6F8;
      --border: #E9ECF0;
      --text: #0F1722;
      --muted: #707C8A;
      --light: #9CA3AF;
      --green: #16A34A;
      --red: #DC2626;
      --blue: #2347E6;
      --orange: #EA580C;
      --radius: 14px;
      --shadow: 0 2px 12px rgba(15,23,34,0.07);
      --shadow-lg: 0 8px 28px rgba(15,23,34,0.13);
    }
    * { box-sizing: border-box; margin: 0; padding: 0; }
    body {
      font-family: 'Hanken Grotesk', system-ui, sans-serif;
      background: var(--bg);
      color: var(--text);
      height: 100vh;
      display: flex;
      flex-direction: column;
      overflow: hidden;
    }

    /* ── LOADING ── */
    #loading {
      position: fixed; inset: 0;
      background: var(--white);
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      z-index: 9999; gap: 14px;
    }
    #loading.hidden { display: none; }
    .loading-logo { font-size: 2.2rem; font-weight: 900; letter-spacing: -1px; }
    .load-symbol { width: 104px; height: 104px; display: block; }
    .load-symbol circle { transform-box: fill-box; transform-origin: center; animation: hastaDot 1.4s ease-in-out infinite; }
    .load-symbol circle:nth-of-type(1) { animation-delay: 0s; }
    .load-symbol circle:nth-of-type(2) { animation-delay: .18s; }
    .load-symbol circle:nth-of-type(3) { animation-delay: .36s; }
    .load-symbol circle:nth-of-type(4) { animation-delay: .54s; }
    @keyframes hastaDot { 0%, 100% { transform: scale(.3); opacity: .2; } 45% { transform: scale(1); opacity: 1; } }
    .spinner {
      width: 34px; height: 34px;
      border: 3px solid var(--border);
      border-top-color: var(--black);
      border-radius: 50%;
      animation: spin 0.7s linear infinite;
    }
    @keyframes spin { to { transform: rotate(360deg); } }
    @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
    @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

    /* ── HEADER ── */
    header {
      background: var(--white);
      border-bottom: 1px solid var(--border);
      padding: 0 20px;
      height: 60px;
      display: flex;
      align-items: center;
      gap: 14px;
      flex-shrink: 0;
      z-index: 100;
    }

    /* Logo com ícone diamante */
    .logo {
      display: flex; align-items: center; gap: 8px;
      text-decoration: none; color: var(--navy); white-space: nowrap;
    }
    .logo-icon {
      position: relative; width: 28px; height: 28px; flex-shrink: 0;
    }
    .logo-icon-sq {
      position: absolute; inset: 0;
      background: var(--navy); border-radius: 6px;
    }
    .logo-icon-border {
      position: absolute; inset: 3px;
      border: 2px solid rgba(255,255,255,0.35);
      transform: rotate(45deg); border-radius: 3px;
    }
    .logo-icon-dot {
      position: absolute; bottom: 5px; right: 5px;
      width: 7px; height: 7px; background: var(--amber);
      border-radius: 50%;
    }
    .logo-text {
      font-family: 'Schibsted Grotesk', sans-serif;
      font-size: 1.35rem; font-weight: 800; letter-spacing: -0.5px;
      color: var(--navy);
    }

    /* Stats no header como chips */
    .header-stats {
      display: flex; gap: 8px; align-items: center;
      font-size: 0.76rem;
    }
    .header-stat-highlight {
      display: flex; align-items: center; gap: 5px;
      background: #FFE500; color: #111;
      border-radius: 100px; padding: 4px 11px 4px 9px;
      font-size: 0.78rem; font-weight: 700;
    }
    .header-stat-highlight strong { color: #111; font-weight: 900; font-size: 0.85rem; }
    .header-stat {
      display: flex; align-items: center; gap: 5px;
      background: var(--bg); border: 1px solid var(--border);
      border-radius: 100px; padding: 4px 11px;
      font-size: 0.78rem; font-weight: 500; color: var(--muted);
    }
    .header-stat strong { color: var(--text); font-weight: 800; font-size: 0.83rem; }

    .header-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

    .layout-toggle {
      display: flex;
      background: var(--bg);
      border-radius: 10px;
      padding: 3px; gap: 2px;
    }
    .layout-btn {
      padding: 5px 12px; border: none;
      background: transparent; border-radius: 7px;
      cursor: pointer; font-size: 0.78rem; font-weight: 600;
      color: var(--muted); font-family: 'Hanken Grotesk', sans-serif;
      transition: all 0.15s; display: flex; align-items: center; gap: 4px;
    }
    .layout-btn.active {
      background: var(--white); color: var(--text);
      box-shadow: 0 1px 4px rgba(0,0,0,0.1);
    }

    .btn-login {
      border: 1.5px solid var(--border); background: transparent;
      color: var(--text); padding: 7px 16px; border-radius: 100px;
      cursor: pointer; font-size: 0.82rem; font-weight: 600;
      font-family: 'Hanken Grotesk', sans-serif; transition: background 0.15s;
    }
    .btn-login:hover { background: var(--bg); }

    .user-btn {
      display: flex; align-items: center; gap: 8px;
      background: var(--navy); color: var(--white);
      border: none; padding: 7px 14px; border-radius: 100px;
      cursor: pointer; font-size: 0.82rem; font-weight: 600;
      font-family: 'Hanken Grotesk', sans-serif; transition: opacity 0.15s;
      position: relative;
    }
    .user-btn:hover { opacity: 0.82; }
    .user-avatar {
      width: 22px; height: 22px; background: var(--amber);
      border-radius: 50%; display: flex; align-items: center;
      justify-content: center; font-size: 0.6rem; font-weight: 900;
      color: var(--white); flex-shrink: 0;
    }

    /* ── SUBBAR (contador + modo urgência) ── */
    .subbar {
      background: var(--white); border-bottom: 1px solid var(--border);
      padding: 6px 16px; display: flex; align-items: center;
      gap: 10px; flex-shrink: 0;
    }
    .subbar .results-label { font-size: 0.82rem; color: var(--muted); flex: 1; }
    .urgency-mode-label { font-size: 0.75rem; color: var(--muted); font-weight: 500; }
    .urgency-mode-btns { display: flex; gap: 4px; }
    .urgency-mode-btn {
      padding: 4px 10px; border: 1.5px solid var(--border);
      background: var(--bg); border-radius: 100px;
      font-size: 0.72rem; font-weight: 600; cursor: pointer;
      font-family: 'Hanken Grotesk', sans-serif;
      color: var(--muted); transition: all 0.15s;
    }
    .urgency-mode-btn:hover { border-color: var(--navy); color: var(--navy); }
    .urgency-mode-btn.active {
      background: var(--navy); border-color: var(--navy);
      color: var(--white);
    }

    /* ── ACABANDO AGORA — linha única de urgentes ── */
    .rail-section {
      padding: 10px 14px 0;
      border-bottom: 2px solid #FFE0C0;
      background: linear-gradient(to bottom, #fff8f2, var(--white));
    }
    .rail-header {
      display: flex; align-items: center; gap: 8px;
      margin-bottom: 8px;
    }
    .rail-title {
      font-size: 0.72rem; font-weight: 800; text-transform: uppercase;
      letter-spacing: 0.6px; color: #C2410C;
    }
    /* Uma linha: mesmo grid do principal, max-height definido via JS após render */
    #rail-grid {
      overflow: hidden;
      padding-bottom: 12px;
    }
    #rail-grid .imovel-card {
      display: flex; flex-direction: column;
    }
    #rail-grid .imovel-card .card-body {
      flex: 1; display: flex; flex-direction: column;
    }
    #rail-grid .imovel-card .card-cal-row { margin-top: auto; }

    #rail-grid .imovel-card.urgente-critico {
      border-color: rgba(220,38,38,0.4) !important;
    }
    #rail-grid .imovel-card.urgente-alto {
      border-color: rgba(234,88,12,0.3) !important;
    }
    #rail-grid .imovel-card.urgente-medio {
      border-color: #D97706 !important;
    }

    /* User dropdown */
    .user-menu-wrap { position: relative; }
    .user-dropdown {
      position: absolute; top: calc(100% + 8px); right: 0;
      width: 260px; background: var(--white);
      border-radius: 16px; box-shadow: var(--shadow-lg);
      border: 1px solid var(--border); z-index: 500; overflow: hidden;
      display: none; animation: slideUp 0.18s ease;
    }
    .user-dropdown.open { display: block; }
    .dd-header { padding: 14px 16px; background: var(--black); color: var(--white); }
    .dd-name { font-size: 0.95rem; font-weight: 800; }
    .dd-email { font-size: 0.75rem; opacity: 0.55; margin-top: 2px; }
    .dd-section { padding: 6px; }
    .dd-item {
      padding: 9px 10px; border-radius: 9px; cursor: pointer;
      font-size: 0.83rem; font-weight: 500; display: flex;
      align-items: center; gap: 8px; transition: background 0.1s;
    }
    .dd-item:hover { background: var(--bg); }
    .dd-item.danger { color: var(--red); }
    .dd-divider { height: 1px; background: var(--border); margin: 3px 6px; }
    .fav-badge {
      margin-left: auto; background: var(--yellow); border-radius: 100px;
      padding: 1px 7px; font-size: 0.7rem; font-weight: 800; color: var(--black);
    }

    /* ── CHAT USUÁRIO ── */
    .btn-chat-header {
      position: relative; background: var(--white); border: 1.5px solid var(--border);
      border-radius: 100px; width: 38px; height: 38px; font-size: 1rem;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      transition: border-color 0.15s, background 0.15s;
    }
    .btn-chat-header:hover { border-color: var(--black); background: var(--black); }
    .btn-chat-header:hover { filter: brightness(0) invert(1); }

    .chat-drawer {
      position: fixed; bottom: 0; right: 24px; z-index: 800;
      width: 380px; height: 520px;
      background: var(--white); border-radius: 16px 16px 0 0;
      box-shadow: 0 -4px 40px rgba(0,0,0,0.18);
      border: 1px solid var(--border); border-bottom: none;
      display: flex; flex-direction: column;
      transform: translateY(100%); transition: transform 0.25s ease;
    }
    .chat-drawer.open { transform: translateY(0); }
    .chat-drawer-header {
      padding: 14px 16px; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; gap: 10px; flex-shrink: 0;
      background: var(--black); border-radius: 16px 16px 0 0; color: #fff;
    }
    .chat-drawer-title { font-size: 0.92rem; font-weight: 700; flex: 1; }
    .chat-drawer-back {
      background: none; border: none; color: rgba(255,255,255,0.7);
      cursor: pointer; font-size: 0.8rem; padding: 2px 6px; border-radius: 6px;
    }
    .chat-drawer-back:hover { color: #fff; }
    .chat-drawer-close {
      background: none; border: none; color: rgba(255,255,255,0.6);
      cursor: pointer; font-size: 1.1rem; line-height: 1;
    }
    .chat-drawer-close:hover { color: #fff; }

    .chat-u-lista { flex: 1; overflow-y: auto; }
    .chat-u-item {
      padding: 12px 16px; border-bottom: 1px solid var(--border);
      cursor: pointer; transition: background 0.1s;
    }
    .chat-u-item:hover { background: var(--bg); }
    .chat-u-nome { font-size: 0.85rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
    .chat-u-preview { font-size: 0.75rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .chat-u-time { font-size: 0.68rem; color: var(--light); margin-top: 2px; }
    .chat-u-badge { background: var(--red); color: #fff; border-radius: 10px; padding: 1px 6px; font-size: 0.65rem; font-weight: 700; }

    .chat-u-msgs { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; background: #FAFAFA; }
    .chat-u-msg-row { display: flex; gap: 6px; align-items: flex-end; }
    .chat-u-msg-row.admin { flex-direction: row-reverse; }
    .chat-u-bubble { max-width: 80%; padding: 8px 12px; border-radius: 13px; font-size: 0.84rem; line-height: 1.4; word-break: break-word; }
    .chat-u-msg-row.admin .chat-u-bubble { background: var(--black); color: #fff; border-bottom-right-radius: 4px; }
    .chat-u-msg-row.usuario .chat-u-bubble { background: var(--white); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
    .chat-u-meta { font-size: 0.65rem; color: var(--muted); white-space: nowrap; }

    .chat-u-input-bar { padding: 10px 12px; border-top: 1px solid var(--border); display: flex; gap: 7px; flex-shrink: 0; }
    .chat-u-input { flex: 1; padding: 8px 11px; border: 1.5px solid var(--border); border-radius: 10px; font-size: 0.85rem; font-family: inherit; outline: none; resize: none; height: 38px; }
    .chat-u-input:focus { border-color: var(--black); }
    .chat-u-send { padding: 0 14px; background: var(--black); color: var(--white); border: none; border-radius: 10px; font-size: 0.85rem; cursor: pointer; font-family: inherit; font-weight: 600; }
    .chat-u-send:hover { opacity: 0.85; }
    .chat-u-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--muted); font-size: 0.85rem; gap: 6px; }

    /* ── FILTER BAR ── */
    .filter-bar {
      background: var(--white); border-bottom: 1px solid var(--border);
      padding: 8px 16px; display: flex; gap: 6px;
      align-items: center; flex-shrink: 0; flex-wrap: wrap;
    }
    .f-sel {
      background: var(--bg); border: 1.5px solid var(--border);
      color: var(--text); padding: 6px 28px 6px 12px;
      border-radius: 100px; font-size: 0.8rem; font-weight: 500;
      font-family: 'Hanken Grotesk', sans-serif; cursor: pointer; outline: none;
      -webkit-appearance: none; appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: right 10px center;
      transition: border-color 0.15s;
    }
    .f-sel:focus { border-color: var(--black); }
    .f-num {
      background: var(--bg); border: 1.5px solid var(--border);
      color: var(--text); padding: 6px 12px; border-radius: 100px;
      font-size: 0.8rem; font-family: 'Hanken Grotesk', sans-serif;
      width: 110px; outline: none; transition: border-color 0.15s;
    }
    .f-num:focus { border-color: var(--black); }
    .f-num::placeholder { color: var(--light); }
    /* Busca textual: campo de busca livre antes do Filtrar */
    .f-search {
      background: var(--bg); border: 1.5px solid var(--border);
      color: var(--text); padding: 6px 14px 6px 32px; border-radius: 100px;
      font-size: 0.8rem; font-family: 'Hanken Grotesk', sans-serif;
      width: 300px; outline: none; transition: border-color 0.15s;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.3-4.3'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: left 11px center;
    }
    .f-search:focus { border-color: var(--black); }
    .f-search::placeholder { color: var(--light); }
    .btn-apply {
      background: var(--black); color: var(--white); border: none;
      padding: 7px 18px; border-radius: 100px; cursor: pointer;
      font-size: 0.8rem; font-weight: 700; font-family: 'Hanken Grotesk', sans-serif;
      transition: opacity 0.15s;
    }
    .btn-apply:hover { opacity: 0.82; }
    .btn-clear {
      background: none; border: none; color: var(--muted); cursor: pointer;
      font-size: 0.78rem; font-family: 'Hanken Grotesk', sans-serif; text-decoration: underline;
      padding: 6px 8px;
    }
    .btn-produtos {
      display: flex; align-items: center; gap: 5px;
      background: var(--bg); border: 1.5px solid var(--border);
      color: var(--muted); padding: 6px 14px; border-radius: 100px;
      cursor: pointer; font-size: 0.8rem; font-weight: 700;
      font-family: 'Hanken Grotesk', sans-serif; transition: all 0.15s;
    }
    .btn-produtos.ativo {
      background: var(--yellow); border-color: var(--black); color: var(--black);
    }
    .filter-sep { width: 1px; height: 22px; background: var(--border); margin: 0 4px; flex-shrink: 0; }

    /* Autocomplete de cidades */
    .ac-wrap { position: relative; display: inline-block; }
    .ac-dropdown {
      display: none; position: absolute; top: calc(100% + 6px); left: 0;
      min-width: 260px; max-height: 300px; overflow-y: auto;
      background: var(--white); border: 1.5px solid var(--border);
      border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.14);
      z-index: 600;
    }
    .ac-dropdown.open { display: block; animation: acFadeIn 0.12s ease; }
    @keyframes acFadeIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
    .ac-header {
      padding: 8px 14px 5px; font-size: 0.68rem; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.4px; color: var(--muted);
      border-bottom: 1px solid var(--border);
    }
    .ac-item {
      padding: 10px 14px; cursor: pointer; font-size: 0.85rem; font-weight: 500;
      color: var(--text); display: flex; align-items: center; gap: 8px;
      transition: background 0.08s; border-radius: 0;
    }
    .ac-item:first-of-type { margin-top: 4px; }
    .ac-item:last-child  { margin-bottom: 4px; }
    .ac-item:hover, .ac-item.ac-active {
      background: var(--yellow); color: var(--black);
    }
    .ac-item-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .ac-item-uf {
      font-size: 0.7rem; font-weight: 700; color: var(--muted);
      background: var(--bg); border-radius: 5px; padding: 1px 6px; flex-shrink: 0;
    }
    .ac-item:hover .ac-item-uf, .ac-item.ac-active .ac-item-uf {
      background: rgba(0,0,0,0.08); color: var(--black);
    }
    .ac-empty {
      padding: 14px; font-size: 0.82rem; color: var(--muted); text-align: center;
    }
    .ac-clear {
      position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
      background: none; border: none; cursor: pointer; color: var(--light);
      font-size: 0.75rem; padding: 2px 4px; display: none;
    }
    .ac-clear.visible { display: block; }

    /* Estado picker — dropdown com pills */
    .uf-wrap { position: relative; display: inline-block; }
    .uf-trigger {
      background: var(--bg); border: 1.5px solid var(--border); color: var(--text);
      padding: 6px 14px; border-radius: 100px; font-size: 0.8rem; font-weight: 500;
      cursor: pointer; outline: none; font-family: 'Hanken Grotesk', sans-serif;
      display: flex; align-items: center; gap: 6px; transition: border-color 0.15s;
    }
    .uf-trigger:focus { border-color: var(--black); }
    .uf-trigger.has-value { background: var(--navy); border-color: var(--navy); color: var(--white); }
    .uf-trigger svg { flex-shrink: 0; transition: transform 0.15s; }
    .uf-trigger.open svg { transform: rotate(180deg); }
    .uf-dropdown {
      display: none; position: absolute; top: calc(100% + 6px); left: 0;
      background: var(--white); border: 1.5px solid var(--border);
      border-radius: 14px; box-shadow: 0 8px 32px rgba(0,0,0,0.14);
      z-index: 600; padding: 10px;
    }
    .uf-dropdown.open { display: block; animation: acFadeIn 0.12s ease; }
    .uf-grid { display: grid; grid-template-columns: repeat(5, 36px); gap: 5px; }
    .uf-pill {
      background: var(--bg); border: 1.5px solid var(--border); color: var(--text);
      border-radius: 8px; font-size: 0.72rem; font-weight: 700;
      font-family: 'Hanken Grotesk', sans-serif; cursor: pointer; padding: 6px 0;
      text-align: center; transition: all 0.1s; line-height: 1;
    }
    .uf-pill:hover { background: #f0f0f0; border-color: #aaa; }
    .uf-pill.active { background: var(--navy); border-color: var(--navy); color: var(--white); }
    .uf-pill-todos { grid-column: 1 / -1; font-size: 0.72rem; font-weight: 600; }

    /* Cidade picker */
    .cidade-wrap { position: relative; display: inline-block; }
    .cidade-dropdown { width: 270px; }
    .cidade-search-wrap {
      padding: 9px 10px 8px;
      border-bottom: 1px solid var(--border);
    }
    .cidade-search {
      width: 100%; box-sizing: border-box;
      background: var(--bg); border: 1.5px solid var(--border);
      color: var(--text); padding: 6px 12px 6px 32px;
      border-radius: 100px; font-size: 0.8rem;
      font-family: 'Hanken Grotesk', sans-serif; outline: none;
      transition: border-color 0.15s;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%239CA3AF' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
      background-repeat: no-repeat; background-position: 10px center;
    }
    .cidade-search:focus { border-color: var(--black); }
    .cidade-search::placeholder { color: var(--light); }
    .cidade-list {
      max-height: 260px; overflow-y: auto; padding: 4px 0;
    }
    .cidade-list::-webkit-scrollbar { width: 3px; }
    .cidade-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
    .cidade-item {
      display: flex; align-items: center; gap: 10px;
      padding: 8px 14px; cursor: pointer;
      font-size: 0.83rem; font-weight: 500; color: var(--text);
      transition: background 0.08s; border-radius: 0;
    }
    .cidade-item:hover, .cidade-item.ac-active { background: var(--bg); }
    .cidade-item.active { background: rgba(15,23,34,0.06); }
    .cidade-radio {
      width: 14px; height: 14px; border-radius: 50%;
      border: 2px solid #D1D5DB; flex-shrink: 0;
      transition: all 0.15s; position: relative;
    }
    .cidade-item:hover .cidade-radio { border-color: #6B7280; }
    .cidade-item.active .cidade-radio {
      border-color: var(--navy); background: var(--navy);
      box-shadow: inset 0 0 0 3px var(--white);
    }
    .cidade-item-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .cidade-item-clear {
      padding: 8px 14px; cursor: pointer; font-size: 0.78rem;
      color: var(--muted); border-top: 1px solid var(--border);
      text-align: center; transition: background 0.08s;
    }
    .cidade-item-clear:hover { background: var(--bg); color: var(--text); }

    /* Cidade picker no cadastro — in-flow (não usa overlay p/ não ser cortado pelo modal) */
    .lead-cidade-wrap { position: relative; }
    .lead-cidade-trigger {
      display: flex; align-items: center; justify-content: space-between;
      text-align: left; cursor: pointer; gap: 8px;
    }
    .lead-cidade-trigger .lc-label { color: var(--light); }
    .lead-cidade-trigger.has-value .lc-label { color: var(--text); }
    .lead-cidade-trigger svg { flex-shrink: 0; transition: transform 0.15s; color: var(--muted); }
    .lead-cidade-trigger.open svg { transform: rotate(180deg); }
    .lead-cidade-panel {
      display: none; margin-top: 6px; background: var(--white);
      border: 1.5px solid var(--border); border-radius: 12px; overflow: hidden;
    }
    .lead-cidade-panel.open { display: block; animation: acFadeIn 0.12s ease; }
    .lead-cidade-panel .cidade-list { max-height: 200px; }

    /* ── MAIN LAYOUT ── */
    /* Coluna: barra de contagem (full-width) no topo + corpo (cards | mapa) abaixo. */
    .main { display: flex; flex-direction: column; flex: 1; overflow: hidden; }

    /* Barra "X imóveis encontrados" — ocupa toda a largura; o mapa começa logo abaixo dela. */
    .results-bar {
      padding: 10px 14px; display: flex; align-items: center;
      justify-content: space-between; flex-shrink: 0;
      border-bottom: 1px solid var(--border); background: var(--white);
    }
    /* Linha cards (esquerda) | mapa (direita), ambos começando na mesma altura, abaixo da contagem. */
    .main-body { display: flex; flex: 1; overflow: hidden; }

    .cards-panel {
      display: flex; flex-direction: column; overflow: hidden;
      transition: width 0.3s ease; width: 56%; flex-shrink: 0;
    }
    .results-label { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
    .cards-scroll { flex: 1; overflow-y: auto; padding: 12px; }
    .cards-scroll::-webkit-scrollbar { width: 4px; }
    .cards-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
    .cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
      gap: 12px;
    }

    .map-panel {
      flex: 1; position: relative;
      border-left: 1px solid var(--border);
    }
    #gmap { width: 100%; height: 100%; }

    .map-placeholder {
      width: 100%; height: 100%;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      gap: 10px; color: var(--muted); padding: 32px; text-align: center;
    }

    /* Layout modes */
    .l-cards .cards-panel { width: 100%; }
    .l-cards .map-panel { display: none; }
    .l-split .cards-panel { width: 56%; }
    .l-split .map-panel { flex: 1; }
    .l-map .cards-panel { display: none; }
    .l-map .map-panel { flex: 1; }

    /* ── PROPERTY CARD ── */
    .imovel-card {
      background: var(--white); border-radius: var(--radius);
      overflow: hidden; cursor: pointer; box-shadow: var(--shadow);
      transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
      border: 2px solid transparent;
      display: flex; flex-direction: column;
      position: relative;
      text-decoration: none; color: inherit; /* card é <a> real (SEO) */
    }
    .imovel-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
    .imovel-card.selected { border-color: var(--amber); }

    /* Urgência modo B: borda sutil */
    .imovel-card.urg-b.urgente-critico { border-color: rgba(220,38,38,0.35); box-shadow: var(--shadow); }
    .imovel-card.urg-b.urgente-alto    { border-color: rgba(234,88,12,0.25); box-shadow: var(--shadow); }

    .card-img-wrap { position: relative; height: 150px; overflow: hidden; flex-shrink: 0; }
    .card-img {
      position: absolute; inset: 0;
      width: 100%; height: 100%;
      object-fit: cover; display: block;
    }

    /* Gradientes placeholder por tipo de imóvel */
    .card-ph-terreno  { background: linear-gradient(135deg, #166534 0%, #15803d 50%, #86efac 100%); }
    .card-ph-casa     { background: linear-gradient(135deg, #92400e 0%, #b45309 50%, #fcd34d 100%); }
    .card-ph-rural    { background: linear-gradient(135deg, #14532d 0%, #16a34a 50%, #a3e635 100%); }
    .card-ph-apartamento { background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #93c5fd 100%); }
    .card-ph-sala     { background: linear-gradient(135deg, #1e3a8a 0%, #3730a3 50%, #a5b4fc 100%); }
    .card-ph-comercial { background: linear-gradient(135deg, #3730a3 0%, #6d28d9 50%, #c4b5fd 100%); }
    .card-ph-galpao   { background: linear-gradient(135deg, #374151 0%, #6b7280 50%, #d1d5db 100%); }
    .card-ph-default  { background: linear-gradient(135deg, #1e40af 0%, #374151 50%, #9ca3af 100%); }

    .card-placeholder {
      width: 100%; height: 100%;
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      gap: 4px; font-size: 2.2rem;
      color: rgba(255,255,255,0.7);
    }

    /* Urgência modo C: progress bar na base da imagem */
    .urg-progress-bar {
      position: absolute; bottom: 0; left: 0; right: 0;
      height: 4px; background: rgba(0,0,0,0.2); z-index: 6; display: none;
    }
    .urg-progress-fill {
      height: 100%; border-radius: 0 2px 2px 0;
      transition: width 1s linear;
    }
    .imovel-card.urg-c .urg-progress-bar { display: block; }
    .imovel-card.urg-d .urg-progress-bar { display: block; }

    .heart-btn {
      position: absolute; top: 9px; right: 9px;
      width: 32px; height: 32px;
      background: rgba(255,255,255,0.92); border: none; border-radius: 50%;
      cursor: pointer; display: flex; align-items: center; justify-content: center;
      font-size: 1rem; color: #D1D5DB; transition: all 0.15s;
      backdrop-filter: blur(4px); z-index: 5;
    }
    .heart-btn:hover { transform: scale(1.15); }
    .heart-btn.on { color: var(--red); }
    .type-pill {
      position: absolute; bottom: 9px; left: 9px;
      background: rgba(0,0,0,0.65); color: var(--white);
      font-size: 0.66rem; font-weight: 700; text-transform: uppercase;
      padding: 3px 8px; border-radius: 100px; backdrop-filter: blur(4px);
    }

    /* Badge de urgência sobre a imagem */
    .urgency-badge {
      position: absolute; bottom: 9px; right: 9px; z-index: 7;
      display: flex; align-items: center; gap: 4px;
      font-size: 0.64rem; font-weight: 800; padding: 3px 9px;
      border-radius: 100px; backdrop-filter: blur(4px);
      box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    }
    .urgency-badge.critico { background: rgba(220,38,38,0.9); color: #fff; }
    .urgency-badge.urgente { background: rgba(234,88,12,0.9); color: #fff; }
    .urgency-badge.soon    { background: rgba(217,119,6,0.9); color: #fff; }
    .urgency-dot {
      width: 5px; height: 5px; background: rgba(255,255,255,0.9); border-radius: 50%;
    }

    /* Cronômetro como badge (modo A e D) — exibido no top-right sobre a foto */
    .urg-timer-badge {
      position: absolute; top: 9px; left: 9px; z-index: 7;
      font-size: 0.62rem; font-weight: 800;
      background: rgba(0,0,0,0.72); color: #fff;
      padding: 3px 8px; border-radius: 100px; backdrop-filter: blur(4px);
      font-variant-numeric: tabular-nums; letter-spacing: 0.3px;
      display: none;
    }
    .imovel-card.urg-a .urg-timer-badge { display: block; }
    .imovel-card.urg-d .urg-timer-badge { display: block; }

    .card-body { padding: 12px 13px 13px; }
    .card-title {
      font-family: 'Schibsted Grotesk', sans-serif;
      font-size: 0.88rem; font-weight: 700; line-height: 1.3; margin-bottom: 4px;
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 2;
      line-clamp: 2;
      overflow: hidden;
    }
    .card-loc { font-size: 0.74rem; color: var(--muted); margin-bottom: 8px; }
    .card-price-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
    .card-price { font-family: 'Schibsted Grotesk', sans-serif; font-size: 1.1rem; font-weight: 900; letter-spacing: -0.5px; }
    .card-disc {
      font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 100px;
    }
    .card-disc.disc-high  { background: #DCFCE7; color: #16A34A; }
    .card-disc.disc-med   { background: #FEF3C7; color: #B45309; }
    .card-disc.disc-low   { background: #F3F4F6; color: #6B7280; }

    /* CTA inline (não-modal) — B · Benefícios em chips, abaixo do contador */
    #cta-slot { flex-shrink: 0; }
    .cta-k{background:var(--navy);color:#fff;border:none;border-radius:100px;
      font:800 .86rem 'Hanken Grotesk',sans-serif;cursor:pointer;white-space:nowrap;padding:12px 22px;}
    .cta-k:hover{opacity:.85;}
    .cta-x{background:none;border:none;color:var(--light);font-size:1rem;cursor:pointer;line-height:1;}
    .cta-b{display:flex;align-items:center;gap:18px;margin:8px 14px;
      background:linear-gradient(100deg,#FFFDF0,#FFF8D6);border:1.5px solid var(--yellow-deep,#F5C400);
      border-radius:14px;padding:15px 18px;position:relative;}
    .cta-b .left{flex:none;}
    .cta-b .left .t{font-size:1rem;font-weight:900;letter-spacing:-.02em;}
    .cta-b .left .s{font-size:.8rem;color:#7A6A1E;font-weight:600;margin-top:1px;}
    .cta-b .chips{display:flex;gap:9px;flex:1;flex-wrap:wrap;}
    .cta-b .chip{display:flex;align-items:center;gap:7px;background:rgba(255,255,255,.7);
      border:1px solid rgba(0,0,0,.06);border-radius:100px;padding:6px 13px;
      font-size:.8rem;font-weight:700;color:var(--ink,#1A1D24);}
    .cta-b .chip svg{width:16px;height:16px;color:var(--green,#1FAE5A);flex:none;}
    .cta-b .cta-x{position:absolute;top:8px;right:10px;}
    @media(max-width:640px){
      .cta-b{flex-wrap:wrap;padding-right:28px;}
      .cta-b .left .s{display:none;}
      .cta-b .chips{order:3;width:100%;}
    }

    /* ── Quick-view (popup do anúncio) — central, estilo do popup do mapa, com tudo ── */
    #quickview {
      position: fixed; left: 50%; top: 50%;
      transform: translate(-50%, -50%);
      width: 400px; max-width: calc(100vw - 24px); max-height: 88vh;
      background: var(--white); border-radius: 16px;
      box-shadow: 0 18px 60px rgba(0,0,0,0.34);
      z-index: 600; overflow-y: auto; display: none;
    }
    @keyframes qvBloom {
      0%   { transform: translate(-50%, -54%) scale(0.82); opacity: 0; }
      68%  { transform: translate(-50%, -49%) scale(1.025); opacity: 1; }
      100% { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    }
    @keyframes qvDismiss {
      from { transform: translate(-50%, -50%) scale(1); opacity: 1; }
      to   { transform: translate(-50%, -46%) scale(0.93); opacity: 0; }
    }
    #quickview.open    { display: block; animation: qvBloom 0.38s cubic-bezier(0.34,1.3,0.64,1) forwards; }
    #quickview.closing { animation: qvDismiss 0.18s ease-in forwards; }
    #qv-scrim {
      position: fixed; inset: 0; background: rgba(0,0,0,0); z-index: 599;
      pointer-events: none; transition: background 0.28s ease;
    }
    #qv-scrim.active { background: rgba(0,0,0,0.42); pointer-events: auto; }
    #quickview .qv-img { position: relative; height: 200px; background: linear-gradient(135deg,#e8eaf0,#d0d4e0); }
    #quickview .qv-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .qv-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; }
    .qv-type {
      position: absolute; bottom: 9px; left: 9px;
      background: rgba(0,0,0,0.65); color: #fff; font-size: 0.64rem; font-weight: 700;
      text-transform: uppercase; padding: 3px 9px; border-radius: 100px; backdrop-filter: blur(4px);
    }
    .qv-x {
      position: absolute; top: 9px; right: 9px;
      width: 30px; height: 30px; border: none; border-radius: 50%;
      background: rgba(255,255,255,0.94); cursor: pointer; font-size: 0.9rem; color: var(--text);
      display: flex; align-items: center; justify-content: center; box-shadow: 0 1px 5px rgba(0,0,0,0.2);
    }
    .qv-x:hover { background: var(--bg); }
    .qv-thumbs { display: flex; gap: 6px; padding: 8px 12px 0; flex-wrap: wrap; }
    .qv-thumbs img { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; opacity: 0.78; }
    .qv-thumbs img:hover, .qv-thumbs img.on { border-color: var(--yellow); opacity: 1; }
    .qv-body { padding: 12px 14px 14px; }
    .qv-title { font-size: 1rem; font-weight: 800; line-height: 1.3; margin-bottom: 5px; }
    .qv-loc { font-size: 0.78rem; color: var(--muted); margin-bottom: 10px; }
    .qv-prow { display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
    .qv-plabel { font-size: 0.66rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; }
    .qv-price { font-size: 1.5rem; font-weight: 900; letter-spacing: -0.5px; }
    .qv-disc { background: var(--yellow); color: var(--black); font-size: 0.74rem; font-weight: 800; padding: 3px 9px; border-radius: 100px; }
    .qv-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; margin-bottom: 12px; }
    .qv-f { display: flex; justify-content: space-between; gap: 8px; font-size: 0.8rem; border-bottom: 1px dashed var(--border); padding-bottom: 4px; }
    .qv-f span { color: var(--muted); } .qv-f b { font-weight: 700; text-align: right; }
    .qv-desc { font-size: 0.82rem; color: #374151; line-height: 1.55; white-space: pre-line;
      max-height: 140px; overflow-y: auto; margin-bottom: 12px;
      background: var(--bg); border-radius: 9px; padding: 9px 11px; }
    .qv-loading-d { font-size: 0.78rem; color: var(--light); margin-bottom: 12px; }
    .qv-actions { display: flex; gap: 8px; }
    .qv-cta { flex: 1; text-align: center; background: var(--yellow); color: var(--black);
      font-weight: 800; padding: 11px; border-radius: 10px; text-decoration: none; font-size: 0.85rem; }
    .qv-cta.dark { background: var(--black); color: #fff; }
    .qv-cta:hover { filter: brightness(0.95); }
    .qv-load { padding: 40px; text-align: center; color: var(--muted); }
    @media (max-width: 640px) { #quickview { width: calc(100vw - 20px); max-height: 90vh; } }
    /* Carrossel de fotos no card */
    .card-img-wrap { position: relative; }
    .carousel-imgs { position: absolute; inset: 0; }
    .carousel-imgs img {
      position: absolute; inset: 0; width: 100%; height: 100%;
      object-fit: cover; opacity: 0; transition: opacity 0.35s ease;
    }
    .carousel-imgs img.active { opacity: 1; }
    .carousel-btn {
      position: absolute; top: 50%; transform: translateY(-50%);
      background: rgba(0,0,0,0.45); border: none; color: #fff;
      width: 26px; height: 36px; border-radius: 5px; cursor: pointer;
      font-size: 0.9rem; display: none; align-items: center; justify-content: center;
      z-index: 8; transition: background 0.15s;
    }
    .carousel-btn:hover { background: rgba(0,0,0,0.7); }
    .carousel-btn.prev { left: 5px; }
    .carousel-btn.next { right: 5px; }
    .card-img-wrap:hover .carousel-btn { display: flex; }
    .carousel-dots {
      position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%);
      display: flex; gap: 4px; z-index: 8;
    }
    .carousel-dot {
      width: 5px; height: 5px; border-radius: 50%;
      background: rgba(255,255,255,0.55); transition: background 0.2s;
    }
    .carousel-dot.active { background: #fff; }
    /* Badge de desconto sobre a foto */
    .disc-badge {
      position: absolute; top: 9px; left: 9px; z-index: 5;
      background: var(--yellow); color: var(--black);
      font-size: 0.82rem; font-weight: 900; letter-spacing: -0.3px;
      padding: 4px 10px; border-radius: 8px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.22);
      line-height: 1.2;
    }
    .disc-badge span { font-size: 0.65rem; font-weight: 700; display: block; opacity: 0.75; }
    .ended-badge {
      position: absolute; top: 9px; right: 9px; z-index: 6;
      display: flex; align-items: center; gap: 4px;
      background: rgba(40,44,52,0.92); color: #fff;
      font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2px;
      padding: 4px 9px; border-radius: 100px; backdrop-filter: blur(4px);
      box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    }
    /* Selo de imóvel recém-inserido na base (últimos 7 dias). Fica no TOPO-CENTRO
       da foto: o desconto ocupa o canto esquerdo e o coração o direito, então o
       centro nunca colide com nenhum dos dois. Some sozinho após 1 semana
       (o back-end só marca im.novo nos primeiros 7 dias). */
    .new-badge {
      position: absolute; top: 9px; left: 50%; transform: translateX(-50%); z-index: 7;
      display: flex; align-items: center; gap: 4px; white-space: nowrap;
      background: linear-gradient(135deg,#16A34A,#22C55E); color: #fff;
      font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px;
      padding: 4px 11px; border-radius: 100px;
      box-shadow: 0 2px 8px rgba(22,163,74,0.40);
      animation: newPulse 2.2s ease-in-out infinite;
    }
    @keyframes newPulse {
      0%,100% { box-shadow: 0 2px 8px rgba(22,163,74,0.40); }
      50%     { box-shadow: 0 2px 14px rgba(22,163,74,0.75); }
    }
    .score-row { display: flex; align-items: center; gap: 6px; }
    .score-track { flex: 1; height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; }
    .score-fill { height: 100%; border-radius: 4px; }
    .score-txt { font-size: 0.7rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
    .card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 7px; }
    .card-cal-row {
      display: flex; align-items: center; justify-content: space-between;
      margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
      gap: 6px;
    }
    .card-cal-info { display: flex; align-items: flex-start; gap: 6px; flex: 1; min-width: 0; }
    .card-cal-icon {
      flex-shrink: 0; width: 28px; height: 28px; border-radius: 7px;
      background: var(--navy); display: flex; align-items: center; justify-content: center;
    }
    .card-cal-icon svg { display: block; }
    .card-cal-dates { font-size: 0.68rem; color: var(--muted); line-height: 1.5; }
    .card-cal-dates strong { color: var(--text); font-weight: 700; font-size: 0.72rem; }
    .card-cal-actions {
      flex-shrink: 0;
      display: flex; flex-direction: column; align-items: center; gap: 4px;
    }
    .card-countdown {
      font-family: 'JetBrains Mono', monospace;
      font-size: 0.72rem; font-weight: 700; color: var(--muted);
      font-variant-numeric: tabular-nums; letter-spacing: 0.2px; white-space: nowrap;
    }
    .btn-gcal {
      flex-shrink: 0; display: flex; align-items: center; gap: 4px;
      background: var(--navy); border: none; border-radius: 100px;
      padding: 5px 12px; cursor: pointer; font-size: 0.68rem; font-weight: 700;
      color: var(--white); font-family: 'Hanken Grotesk', sans-serif; white-space: nowrap;
      transition: all 0.15s;
    }
    .btn-gcal:hover { opacity: 0.85; }
    .ctag {
      font-size: 0.66rem; font-weight: 600; padding: 2px 7px;
      border-radius: 100px; background: var(--bg); color: var(--muted);
    }
    .ctag-baixo { background: #DCFCE7; color: #15803D; }
    .ctag-medio { background: #FEF3C7; color: #B45309; }
    .ctag-alto  { background: #FEE2E2; color: #B91C1C; }
    .card-id {
      font-size: 0.67rem; font-weight: 700; color: var(--light);
      font-variant-numeric: tabular-nums; letter-spacing: 0.2px;
      background: var(--bg); border-radius: 5px;
      padding: 1px 6px; display: inline-block;
    }

    /* ── MODALS ── */
    .overlay {
      position: fixed; inset: 0;
      background: rgba(0,0,0,0.48); backdrop-filter: blur(4px);
      display: flex; align-items: center; justify-content: center;
      z-index: 1000; animation: fadeIn 0.2s ease;
    }
    .overlay.hidden { display: none; }
    .modal {
      background: var(--white); border-radius: 24px;
      width: 100%; max-width: 430px; max-height: 92vh; overflow-y: auto;
      animation: slideUp 0.22s ease;
    }
    .modal-head {
      padding: 22px 22px 0;
      display: flex; align-items: flex-start; justify-content: space-between;
    }
    .modal-title { font-size: 1.35rem; font-weight: 900; }
    .modal-sub { font-size: 0.83rem; color: var(--muted); margin-top: 3px; }
    .modal-x {
      background: var(--bg); border: none; width: 30px; height: 30px;
      border-radius: 50%; cursor: pointer; font-size: 0.9rem;
      display: flex; align-items: center; justify-content: center;
      color: var(--muted); flex-shrink: 0; margin-top: 2px;
    }
    .modal-x:hover { background: var(--border); }
    .modal-body { padding: 18px 22px 22px; }

    .highlight-box {
      background: var(--yellow); border-radius: 10px; padding: 12px 14px;
      margin-bottom: 14px; font-size: 0.83rem; font-weight: 600; color: var(--black);
    }
    .fgroup { margin-bottom: 12px; }
    .flabel {
      display: block; font-size: 0.72rem; font-weight: 700;
      text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 5px; color: var(--text);
    }
    .finput {
      width: 100%; background: var(--bg); border: 1.5px solid var(--border);
      color: var(--text); padding: 11px 13px; border-radius: 11px;
      font-size: 0.88rem; font-family: 'Hanken Grotesk', sans-serif; outline: none;
      transition: border-color 0.15s;
    }
    .finput:focus { border-color: var(--black); background: var(--white); }
    .frow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
    .btn-submit {
      width: 100%; background: var(--black); color: var(--white);
      border: none; padding: 13px; border-radius: 100px;
      font-size: 0.93rem; font-weight: 700; font-family: 'Hanken Grotesk', sans-serif;
      cursor: pointer; margin-top: 6px; transition: opacity 0.15s;
    }
    .btn-submit:hover { opacity: 0.82; }
    .modal-foot { text-align: center; font-size: 0.8rem; color: var(--muted); margin-top: 12px; }
    .modal-foot a { color: var(--text); font-weight: 700; cursor: pointer; text-decoration: underline; }
    .form-error { color: var(--red); font-size: 0.78rem; margin-top: -6px; margin-bottom: 6px; display: none; }

    /* ── FAV DRAWER ── */
    .fav-drawer {
      position: fixed; top: 0; right: -370px; width: 350px; height: 100vh;
      background: var(--white); z-index: 600;
      box-shadow: -4px 0 28px rgba(0,0,0,0.12);
      display: flex; flex-direction: column; transition: right 0.3s ease;
    }
    .fav-drawer.open { right: 0; }
    .fav-head {
      padding: 18px; border-bottom: 1px solid var(--border);
      display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
    }
    .fav-head-title { font-size: 1.05rem; font-weight: 800; }
    .fav-close {
      background: var(--bg); border: none; width: 30px; height: 30px;
      border-radius: 50%; cursor: pointer; display: flex; align-items: center;
      justify-content: center; color: var(--muted); font-size: 0.9rem;
    }
    .fav-close:hover { background: var(--border); }
    .fav-body { flex: 1; overflow-y: auto; padding: 12px; }
    .fav-item {
      background: var(--bg); border-radius: 12px; padding: 10px;
      margin-bottom: 8px; cursor: pointer; display: flex; gap: 10px;
      transition: background 0.1s;
    }
    .fav-item:hover { background: var(--border); }
    .fav-thumb {
      width: 60px; height: 60px; border-radius: 8px; object-fit: cover;
      background: var(--border); flex-shrink: 0;
    }
    .fav-info { flex: 1; min-width: 0; }
    .fav-title { font-size: 0.82rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .fav-price { font-size: 0.9rem; font-weight: 900; margin-top: 2px; }
    .fav-loc { font-size: 0.72rem; color: var(--light); margin-top: 2px; }
    .fav-empty { text-align: center; padding: 48px 20px; color: var(--muted); }
    .fav-empty-icon { font-size: 2.5rem; margin-bottom: 8px; }

    @keyframes hcShimmer { 0%,100%{opacity:.4} 50%{opacity:1} }
    /* Legenda do mapa de pins (canvas) */
    #pin-legend {
      position: absolute; bottom: 90px; left: 12px; z-index: 10;
      background: rgba(255,255,255,0.92); border-radius: 10px;
      padding: 7px 11px; font-family: 'Inter',sans-serif; font-size: 11px;
      box-shadow: 0 2px 10px rgba(0,0,0,0.15); pointer-events: none;
      display: flex; flex-direction: column; gap: 4px; line-height: 1.4;
    }
    .pin-legend-row { display: flex; align-items: center; gap: 6px; }
    .pin-dot { width:11px;height:11px;border-radius:50%;flex-shrink:0; }
    .pd-green  { background:#1DB954; }
    .pd-yellow { background:#F5C518; }
    .pd-red    { background:#E53935; }


    /* Pegman (Street View drag handle) — fundo escuro compatível com tema do mapa */
    .gm-svpc,
    .gm-svpc > div,
    [data-controlname="StreetViewPegman"],
    [data-controlname="StreetViewPegman"] > div {
      background-color: #11161d !important;
      border-radius: 4px !important;
    }

    /* Map info window overrides */
    .gm-style .gm-style-iw-c { border-radius: 14px !important; box-shadow: var(--shadow-lg) !important; padding: 0 !important; }
    .gm-style .gm-style-iw-d { overflow: hidden !important; }
    .gm-style .gm-style-iw-t::after { display: none; }
    .gm-style button.gm-ui-hover-effect { top: 6px !important; right: 6px !important; }
    .map-popup { font-family: 'Hanken Grotesk', sans-serif; width: 230px; padding: 12px; }
    .map-popup img { width: 100%; height: 110px; object-fit: cover; border-radius: 10px; margin-bottom: 9px; }
    .map-popup-type { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; color: var(--muted); margin-bottom: 3px; }
    .map-popup-title { font-size: 0.86rem; font-weight: 700; margin-bottom: 6px; line-height: 1.3; }
    .map-popup-price { font-size: 1.05rem; font-weight: 900; }
    .map-popup-disc { font-size: 0.68rem; font-weight: 800; background: var(--yellow); color: var(--black); padding: 2px 7px; border-radius: 100px; margin-left: 6px; }
    .map-popup-loc { font-size: 0.72rem; color: var(--light); margin-top: 5px; }
    .map-popup-btn {
      display: block; margin-top: 10px; background: var(--black); color: var(--white);
      border: none; padding: 9px; border-radius: 10px; cursor: pointer;
      font-size: 0.8rem; font-weight: 700; width: 100%; text-align: center;
      font-family: 'Hanken Grotesk', sans-serif;
    }
    .map-popup-btn:hover { opacity: 0.82; }

    @media (max-width: 768px) {
      .l-split .cards-panel { width: 100%; }
      .l-split .map-panel { display: none; }
      .filter-bar { overflow-x: auto; flex-wrap: nowrap; }
    }

    /* ── Urgência de vencimento ─────────────────────────────────────────── */
    /* Encerra em < 24h (crítico) */
    .imovel-card.urgente-critico {
      border-color: rgba(239,68,68,0.35) !important;
      box-shadow: var(--shadow);
    }
    /* Encerra em 1–3 dias (urgente) */
    .imovel-card.urgente-urgente {
      border-color: #F97316 !important;
      box-shadow: 0 0 0 2px rgba(249,115,22,0.15), var(--shadow);
    }
    /* Encerra em 3–7 dias (em breve) */
    .imovel-card.urgente-soon {
      border-color: #EAB308 !important;
      box-shadow: 0 0 0 2px rgba(234,179,8,0.15), var(--shadow);
    }

    /* Badge de urgência sobre a foto — canto inferior-direito, acima do type-pill */
    .urgency-badge {
      position: absolute; bottom: 36px; right: 9px;
      z-index: 7; white-space: nowrap;
      display: flex; align-items: center; gap: 4px;
      font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.3px;
      padding: 4px 11px; border-radius: 100px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.22);
    }
    .urgency-badge.critico {
      background: #EF4444; color: #fff;
    }
    .urgency-badge.urgente {
      background: #F97316; color: #fff;
    }
    .urgency-badge.soon {
      background: #EAB308; color: #1a1a1a;
    }

    /* Tag de prazo inline — aparece na mesma linha da data de encerramento */
    .prazo-tag {
      display: inline;
      font-size: 0.62rem; font-weight: 700; letter-spacing: 0.1px;
      padding: 1px 5px; border-radius: 3px;
      margin-left: 5px;
      vertical-align: middle; white-space: nowrap;
    }
    .prazo-tag.p-crit { background: #FEE2E2; color: #DC2626; animation: tagPulse 1.8s ease-in-out infinite; }
    .prazo-tag.p-urg  { background: #FFEDD5; color: #C2410C; }
    .prazo-tag.p-soon { background: #FEF9C3; color: #A16207; }
    .prazo-tag.p-med  { background: #DCFCE7; color: #15803D; }
    .prazo-tag.p-low  { background: #ECFDF5; color: #059669; }
    @keyframes tagPulse {
      0%,100% { opacity: 1; }
      50%      { opacity: 0.5; }
    }

    /* ── Calendário de Leilões ──────────────────────────────────────────── */
    .cal-modal {
      position: fixed; inset: 0; z-index: 900;
      display: flex; align-items: center; justify-content: center;
    }
    .cal-overlay {
      position: absolute; inset: 0;
      background: rgba(0,0,0,0.55); backdrop-filter: blur(3px);
      opacity: 0; transition: opacity 0.25s ease;
    }
    .cal-modal-open .cal-overlay { opacity: 1; }
    .cal-panel {
      position: relative; z-index: 1;
      background: var(--white); border-radius: 20px;
      box-shadow: 0 24px 80px rgba(0,0,0,0.22);
      width: min(1040px, 96vw); max-height: 92vh;
      display: flex; flex-direction: column; overflow: hidden;
      transform: scale(0.96) translateY(12px); opacity: 0;
      transition: transform 0.25s ease, opacity 0.25s ease;
    }
    .cal-modal-open .cal-panel { transform: scale(1) translateY(0); opacity: 1; }

    /* Cabeçalho */
    .cal-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 18px 22px; border-bottom: 1px solid var(--border);
      flex-shrink: 0; gap: 12px; flex-wrap: wrap;
    }
    .cal-head-left { display: flex; align-items: baseline; gap: 10px; }
    .cal-title { font-size: 1.1rem; font-weight: 900; }
    .cal-subtitle { font-size: 0.78rem; color: var(--muted); }
    .cal-head-actions { display: flex; align-items: center; gap: 8px; }
    .cal-btn-secondary {
      background: var(--bg); border: 1.5px solid var(--border);
      color: var(--text); border-radius: 10px; padding: 7px 14px;
      font-size: 0.8rem; font-weight: 700; cursor: pointer;
      font-family: inherit; transition: background 0.15s;
    }
    .cal-btn-secondary:hover { background: var(--border); }
    .cal-btn-gcal {
      background: #fff; border: 1.5px solid #ddd;
      color: #444; border-radius: 10px; padding: 7px 14px;
      font-size: 0.8rem; font-weight: 700; cursor: pointer;
      font-family: inherit; display: flex; align-items: center; gap: 5px;
      transition: box-shadow 0.15s;
    }
    .cal-btn-gcal:hover { box-shadow: 0 2px 8px rgba(66,133,244,0.25); border-color: #4285F4; }
    .cal-close-btn {
      background: var(--bg); border: none; width: 32px; height: 32px;
      border-radius: 50%; cursor: pointer; font-size: 1rem;
      display: flex; align-items: center; justify-content: center;
      color: var(--muted); flex-shrink: 0;
    }
    .cal-close-btn:hover { background: var(--border); }

    /* Navegação de mês */
    .cal-nav {
      display: flex; align-items: center; gap: 8px;
      padding: 12px 22px; border-bottom: 1px solid var(--border);
      flex-shrink: 0;
    }
    .cal-nav-btn {
      background: var(--bg); border: none; width: 32px; height: 32px;
      border-radius: 8px; cursor: pointer; font-size: 1.2rem; font-weight: 700;
      display: flex; align-items: center; justify-content: center;
      color: var(--text); transition: background 0.1s;
    }
    .cal-nav-btn:hover { background: var(--border); }
    .cal-mes-label {
      font-size: 1rem; font-weight: 800; flex: 1; text-align: center;
      letter-spacing: 0.02em;
    }
    .cal-nav-today {
      background: var(--black); color: var(--white); border: none;
      border-radius: 8px; padding: 6px 14px; font-size: 0.78rem;
      font-weight: 700; cursor: pointer; font-family: inherit;
      transition: opacity 0.15s;
    }
    .cal-nav-today:hover { opacity: 0.82; }

    /* Grade */
    .cal-week-header {
      display: grid; grid-template-columns: repeat(7, 1fr);
      padding: 0 16px;
      border-bottom: 1px solid var(--border); flex-shrink: 0;
    }
    .cal-week-header > div {
      text-align: center; padding: 8px 4px;
      font-size: 0.72rem; font-weight: 700; color: var(--muted);
      text-transform: uppercase; letter-spacing: 0.04em;
    }
    .cal-week-header > div:first-child { color: #EF4444; }
    .cal-week-header > div:last-child  { color: #4285F4; }

    .cal-grid {
      flex: 1; overflow-y: auto;
      display: grid; grid-template-columns: repeat(7, 1fr);
      padding: 0 16px 16px;
      gap: 0;
    }
    .cal-cell {
      min-height: 90px; border: 1px solid transparent;
      border-bottom: 1px solid var(--border);
      border-right: 1px solid var(--border);
      padding: 6px 5px 4px;
      cursor: pointer; transition: background 0.1s;
      position: relative;
    }
    .cal-cell:hover { background: #f9fafb; }
    .cal-cell.out-month { background: #fafafa; opacity: 0.5; cursor: default; }
    .cal-cell.out-month:hover { background: #fafafa; }
    .cal-cell.today .cal-day-num {
      background: var(--black); color: var(--yellow);
      border-radius: 50%; width: 24px; height: 24px;
      display: flex; align-items: center; justify-content: center;
      font-weight: 900; font-size: 0.82rem;
    }
    .cal-cell.has-events { cursor: pointer; }
    .cal-cell.selected { background: #EEF2FF; border-color: #6366F1 !important; border-radius: 4px; }
    .cal-day-num {
      font-size: 0.78rem; font-weight: 700; color: var(--text);
      margin-bottom: 4px; line-height: 1; display: inline-block;
      padding: 3px 4px;
    }
    .cal-cell.out-month .cal-day-num { color: var(--light); }

    /* Thumbnails de imóveis no dia */
    .cal-thumbs {
      display: flex; flex-wrap: wrap; gap: 2px; margin-top: 2px;
    }
    .cal-thumb-wrap {
      position: relative; cursor: pointer;
    }
    .cal-thumb {
      width: 34px; height: 34px; border-radius: 6px;
      object-fit: cover; border: 2px solid var(--white);
      box-shadow: 0 1px 4px rgba(0,0,0,0.15);
      background: var(--border);
      display: block;
    }
    .cal-thumb:hover { transform: scale(1.12); z-index: 2; border-color: var(--yellow); }
    .cal-thumb-more {
      width: 34px; height: 34px; border-radius: 6px;
      background: var(--black); color: var(--yellow);
      display: flex; align-items: center; justify-content: center;
      font-size: 0.65rem; font-weight: 900; border: 2px solid var(--white);
      box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    }

    /* Ponto de evento no dia (alternativo quando sem foto) */
    .cal-dot {
      display: inline-block; width: 7px; height: 7px;
      border-radius: 50%; background: var(--black); margin: 1px;
    }

    /* Painel lateral de eventos do dia */
    .cal-day-panel {
      position: absolute; right: 0; top: 0; bottom: 0;
      width: 340px; background: var(--white);
      border-left: 1px solid var(--border);
      display: flex; flex-direction: column;
      box-shadow: -6px 0 24px rgba(0,0,0,0.08);
      z-index: 10; border-radius: 0 20px 20px 0;
      overflow: hidden;
    }
    .cal-day-panel-head {
      padding: 16px 18px; border-bottom: 1px solid var(--border);
      font-weight: 800; font-size: 0.9rem;
      display: flex; align-items: center; justify-content: space-between;
      flex-shrink: 0;
    }
    .cal-day-events {
      flex: 1; overflow-y: auto; padding: 10px;
    }

    /* Card de evento no painel do dia */
    .cal-event-card {
      border-radius: 14px; overflow: hidden;
      border: 1.5px solid var(--border); margin-bottom: 10px;
      background: var(--white); cursor: pointer;
      transition: box-shadow 0.15s, border-color 0.15s;
    }
    .cal-event-card:hover { box-shadow: var(--shadow); border-color: #999; }
    .cal-event-img {
      width: 100%; height: 120px; object-fit: cover;
      background: var(--border); display: block;
    }
    .cal-event-body { padding: 10px 12px; }
    .cal-event-tipo {
      font-size: 0.65rem; font-weight: 700; text-transform: uppercase;
      color: var(--muted); margin-bottom: 3px;
    }
    .cal-event-titulo {
      font-size: 0.85rem; font-weight: 700; line-height: 1.3;
      margin-bottom: 5px;
      overflow: hidden; text-overflow: ellipsis;
      display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical;
    }
    .cal-event-preco {
      font-size: 1rem; font-weight: 900; margin-bottom: 3px;
    }
    .cal-event-desc {
      display: flex; justify-content: space-between; align-items: center;
      gap: 6px;
    }
    .cal-event-loc { font-size: 0.72rem; color: var(--light); flex: 1; }
    .cal-event-date-badge {
      font-size: 0.68rem; font-weight: 800; background: var(--yellow);
      color: var(--black); padding: 2px 8px; border-radius: 100px;
      white-space: nowrap;
    }
    .cal-event-date-badge.segunda { background: #DBEAFE; color: #1D4ED8; }
    .cal-event-actions {
      padding: 8px 12px; border-top: 1px solid var(--border);
      display: flex; gap: 6px;
    }
    .cal-event-btn {
      flex: 1; border: none; border-radius: 8px; padding: 7px;
      font-size: 0.75rem; font-weight: 700; cursor: pointer;
      font-family: inherit; transition: opacity 0.15s;
    }
    .cal-event-btn:hover { opacity: 0.82; }
    .cal-event-btn-detail { background: var(--black); color: var(--white); }
    .cal-event-btn-gcal {
      background: #fff; border: 1.5px solid #ddd !important;
      color: #444; display: flex; align-items: center;
      justify-content: center; gap: 4px; padding: 6px;
    }
    .cal-event-empty {
      text-align: center; padding: 32px 16px; color: var(--muted); font-size: 0.85rem;
    }

    /* Toast de notificação */
    .cal-toast {
      position: fixed; bottom: 24px; left: 50%;
      transform: translateX(-50%) translateY(80px);
      background: var(--black); color: var(--white);
      padding: 12px 22px; border-radius: 12px;
      font-size: 0.85rem; font-weight: 700;
      box-shadow: 0 8px 24px rgba(0,0,0,0.25);
      transition: transform 0.3s ease, opacity 0.3s ease;
      opacity: 0; z-index: 9999; white-space: nowrap;
    }
    .cal-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

    @media (max-width: 768px) {
      .cal-panel { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; }
      .cal-day-panel { width: 100%; border-radius: 0; }
      .cal-head { flex-wrap: wrap; gap: 8px; }
      .cal-head-actions { flex-wrap: wrap; }
      .cal-thumb { width: 28px; height: 28px; }
      .cal-thumb-more { width: 28px; height: 28px; }
      .cal-cell { min-height: 70px; }
    }

    /* Quando o topbar move o #f-estado para dentro do painel, desfaz o display:none inline */
    .m-topdrop select,
    .m-topdrop input[type="text"],
    .m-topdrop input[type="number"] { display: block !important; }

    /* ── MOBILE: a topbar de ícones (hasta-mobile-top.css) é carregada condicionalmente ── */
    @media (max-width: 900px) {
      /* Oculta a filter-bar — a topbar de ícones toma o lugar dela */
      .filter-bar { display: none !important; }

      .d-estado,
      .d-cidade { display: none !important; }

      /* Mobile: mostra só o total de imóveis como badge AMARELO ao lado do logo */
      .header-stats { display: flex; }
      .header-stats .header-stat { display: none; }
      .header-stat-highlight {
        display: inline-flex; align-items: baseline; gap: 4px;
        background: #FFE500; color: #111;
        padding: 3px 10px; border-radius: 100px;
        font-size: 0.72rem; font-weight: 600;
      }
      .header-stat-highlight strong { color: #111; font-weight: 900; font-size: 0.92rem; }

      /* Mobile: 2 imóveis por linha */
      .cards-grid { grid-template-columns: 1fr 1fr; gap: 10px; }

      /* Mobile: botão Google Cal abaixo das datas (não fica truncado ao lado) */
      .card-cal-row { flex-direction: column; align-items: stretch; gap: 7px; }
      .btn-gcal { justify-content: center; }

      /* Mobile: cards harmônicos — mesma altura, foto no topo e Google Cal no rodapé,
         com descrição/preço/datas alinhados na mesma linha entre os cards */
      .cards-grid { align-items: stretch; }
      .imovel-card { height: 100%; }
      .card-body { flex: 1; display: flex; flex-direction: column; }
      .card-title { min-height: 2.34em; }      /* descrição: 2 linhas reservadas */
      .card-price-row { margin-top: 2px; }
      .card-cal-row { margin-top: auto; }       /* Google Cal sempre embaixo */
      .card-cal-dates { min-height: 2.7em; }    /* datas: alinha 1 ou 2 linhas */

      /* Mobile: badge "N imóveis" centralizado no MEIO da tela (afastado do logo) */
      header { padding: 0 14px; gap: 10px; position: relative; }
      .header-stats {
        position: absolute !important; left: 50% !important; top: 50% !important;
        transform: translate(-50%, -50%) !important; margin: 0 !important; flex: none !important;
      }
      .header-right { margin-left: auto; gap: 8px; }
      .btn-login { padding: 7px 14px; white-space: nowrap; }

      /* Mobile: ocultar seletor de modo de urgência */
      .urgency-mode-label,
      .urgency-mode-btns { display: none !important; }

      /* Mobile: card-img proporcional (dark theme força 152px; aqui limitamos a 130px) */
      .card-img-wrap { height: 130px !important; }
      /* Mobile: timer de countdown no card é legível só em telas grandes */
      .urg-timer-badge { display: none !important; }

      /* prazo-tag é inline e não quebra linha — visível no mobile também */

      /* Mobile: remove altura mínima reservada para 2 linhas de datas —
         com o chip oculto, todos os cards ficam com a mesma altura */
      .card-cal-dates { min-height: 0 !important; }
    }
