/* ============================================================
   INTERFACE-ESTUDANTE — Conversas do estudante (referências 3 e 4).
   Tudo exige #view .conversation-page-est, que screen.js só gera para a conta de
   estudante: imobiliária, proprietário, república e responsável seguem com
   conversations/styles.css como antes.
   Celular: só o cabeçalho próprio do estudante (busca em ícone) mora aqui; lista e chat seguem o
   padrão comum de todas as contas (conversations/mobile.css).
   ============================================================ */

/* cabeçalho: título + busca que vira ícone e se expande ao receber foco ou texto */
#view .conversation-page-est .conversation-page-header{padding:18px 20px 0}
#view .conversation-page-est .conversation-head-row{position:relative;display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:48px}
#view .conversation-page-est .conversation-head-row h1{margin:0;font-size:30px;font-weight:800;letter-spacing:-.8px}
#view .conversation-page-est .conversation-head-row .conversation-search{
  flex:none;width:48px;height:48px;min-height:0;margin:0;padding:0;justify-content:center;gap:0;cursor:pointer;
  border-radius:50%;border-color:transparent;background:#F8F3EC;color:var(--terracota);box-shadow:none
}
#view .conversation-page-est .conversation-head-row .conversation-search > span{font-size:21px}
#view .conversation-page-est .conversation-head-row .conversation-search input{width:0;min-width:0;padding:0;opacity:0}
#view .conversation-page-est .conversation-head-row .conversation-search:focus-within,
#view .conversation-page-est .conversation-head-row .conversation-search:has(input:not(:placeholder-shown)){
  position:absolute;inset:0;width:auto;height:auto;justify-content:flex-start;gap:10px;padding:0 14px;
  border-radius:24px;border-color:var(--linha);background:var(--papel);color:var(--cinza);z-index:1
}
#view .conversation-page-est .conversation-head-row .conversation-search:focus-within{border-color:var(--terracota);box-shadow:0 0 0 3px var(--terracota-fraco)}
#view .conversation-page-est .conversation-head-row .conversation-search:focus-within input,
#view .conversation-page-est .conversation-head-row .conversation-search:has(input:not(:placeholder-shown)) input{width:100%;opacity:1;padding:11px 0}

/* filtros por imóvel */
#view .conversation-page-est .conversation-filters{padding:16px 20px 14px;gap:10px}
#view .conversation-page-est .conversation-filter{min-height:44px;padding:9px 18px;border-radius:22px;font-size:15px;font-weight:600;color:var(--tinta);background:var(--papel)}
#view .conversation-page-est .conversation-filter b{min-width:0;height:auto;padding:0;background:none;color:var(--cinza);font:600 14px 'Inter',sans-serif}
#view .conversation-page-est .conversation-filter.on{background:var(--terracota-fraco);border-color:var(--terracota-fraco);color:var(--terracota)}
#view .conversation-page-est .conversation-filter.on b{background:none;color:var(--terracota)}

/* linhas */
#view .conversation-page-est .conversation-row > .av{background:#F6E7D2;color:var(--terracota);font-weight:800}
#view .conversation-page-est .conversation-row-top strong{font-weight:700}
#view .conversation-page-est .conversation-row-property-copy strong{color:var(--tinta)}
#view .conversation-page-est .conversation-row .conv-badge{min-width:24px;height:24px;border-radius:12px;font-size:12px}

/* Celular: o padrão de lista e de chat é o mesmo de todas as contas (conversations/mobile.css). */

/* filtro por imóvel (lista suspensa, js/features/conversations/filtro-imovel.js): só no computador.
   No celular continuam as pílulas de antes. */
#view .conversation-page-est .conv-filtro-imovel{display:none}

/* ---------------- computador (referência 3 + REFINAMENTO-DESKTOP) ----------------
   A página tem a altura útil da janela (descontada a barra superior) e NÃO cresce com o conteúdo:
   antes, flex:1 1 0% dentro de #view (coluna de altura automática) fazia a página crescer até o tamanho
   da lista — a página inteira rolava, o campo de mensagem ia para longe e a barra aparecia no meio.
   Agora a lista e o histórico rolam por dentro; o campo de mensagem fica no rodapé do painel direito. */
@media (min-width:900px){
  #view.student-conversas .conversation-page.conversation-page-est{
    flex:none;height:calc(100vh - var(--st-barra-altura,0px) - 1px);min-height:480px;padding:0;overflow:hidden;background:var(--papel)
  }
  #view .conversation-page-est .conversation-workbench,
  #view .conversation-page-est .conversation-workbench.aberta{
    flex:1;height:100%;min-height:0;display:grid;grid-template-columns:minmax(320px,28%) minmax(0,1fr);grid-template-rows:minmax(0,1fr);
    border:0;border-radius:0;box-shadow:none;background:var(--papel)
  }
  /* coluna da lista: cabeçalho e filtros fixos; só a lista rola */
  #view .conversation-page-est .conversation-list-column{display:flex;flex-direction:column;border-right:1px solid #eee7dd;min-height:0;overflow:hidden}
  #view .conversation-page-est .conversation-page-header{padding:20px 20px 0;flex:none}
  #view .conversation-page-est .conversation-head-row{min-height:42px}
  #view .conversation-page-est .conversation-head-row h1{font-size:26px;letter-spacing:-.6px}
  #view .conversation-page-est .conversation-head-row .conversation-search{width:42px;height:42px}
  #view .conversation-page-est .conversation-head-row .conversation-search > span{font-size:19px}
  #view .conversation-page-est .conversation-list-region{flex:1;min-height:0;display:flex;flex-direction:column;overflow:hidden}
  #view .conversation-page-est .conversation-list{flex:1;min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:0 10px 12px;display:flex;flex-direction:column;gap:2px}
  #view .conversation-page-est .conversation-list-more{flex:none;margin:8px 12px 12px;width:auto}

  /* filtros: "Todos" (contagem real) + "Filtrar por imóvel"; as pílulas por imóvel saem do computador */
  #view .conversation-page-est .conversation-filters{flex:none;position:relative;z-index:5;overflow:visible;flex-wrap:nowrap;align-items:center;padding:12px 20px 12px;gap:8px}
  #view .conversation-page-est .conversation-filters > .conversation-filter:not([data-v="todos"]){display:none}
  #view .conversation-page-est .conversation-filter{flex:none;min-height:36px;padding:7px 14px;border-radius:20px;font-size:14px}
  #view .conversation-page-est .conversation-filter b{font-size:13px}
  #view .conversation-page-est .conv-filtro-imovel{display:flex;align-items:center;gap:4px;min-width:0;flex:1}
  #view .conversation-page-est .conv-filtro-imovel-botao{
    display:inline-flex;align-items:center;gap:7px;min-width:0;max-width:100%;min-height:36px;padding:7px 12px;cursor:pointer;
    border:1px solid var(--linha);border-radius:20px;background:var(--papel);color:var(--tinta);font:inherit;font-size:14px;font-weight:600
  }
  #view .conversation-page-est .conv-filtro-imovel-botao > svg{flex:none;font-size:16px;color:var(--cinza)}
  #view .conversation-page-est .conv-filtro-imovel-botao > span:first-of-type{min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #view .conversation-page-est .conv-filtro-seta{display:flex;flex:none;font-size:14px;transform:rotate(90deg);transition:transform .15s}
  #view .conversation-page-est .conv-filtro-imovel-botao[aria-expanded="true"] .conv-filtro-seta{transform:rotate(-90deg)}
  #view .conversation-page-est .conv-filtro-imovel-botao:hover{border-color:var(--terracota)}
  #view .conversation-page-est .conv-filtro-imovel-botao.on{background:var(--terracota-fraco);border-color:var(--terracota-fraco);color:var(--terracota)}
  #view .conversation-page-est .conv-filtro-imovel-botao.on > svg{color:var(--terracota)}
  #view .conversation-page-est .conv-filtro-limpar{
    flex:none;width:32px;height:32px;display:flex;align-items:center;justify-content:center;cursor:pointer;
    border:0;border-radius:50%;background:none;color:var(--cinza);font-size:15px
  }
  #view .conversation-page-est .conv-filtro-limpar:hover{background:var(--apoio);color:var(--tinta)}
  #view .conversation-page-est .conv-painel-imoveis{
    position:absolute;top:calc(100% - 4px);left:16px;right:16px;z-index:20;display:flex;flex-direction:column;
    max-height:min(420px,calc(100vh - var(--st-barra-altura,0px) - 160px));padding:8px;
    background:var(--papel);border:1px solid #ebe6df;border-radius:16px;box-shadow:0 16px 40px rgba(41,36,33,.16)
  }
  #view .conversation-page-est .conv-painel-imoveis[hidden]{display:none}
  #view .conversation-page-est .conv-painel-busca{
    flex:none;display:flex;align-items:center;gap:8px;margin:2px 2px 8px;padding:0 12px;min-height:40px;
    border:1px solid var(--linha);border-radius:12px;color:var(--cinza);font-size:16px
  }
  #view .conversation-page-est .conv-painel-busca:focus-within{border-color:var(--terracota);box-shadow:0 0 0 3px var(--terracota-fraco)}
  #view .conversation-page-est .conv-painel-busca input{flex:1;min-width:0;border:0;outline:0;padding:9px 0;background:none;font:inherit;font-size:14px;color:var(--tinta)}
  #view .conversation-page-est .conv-painel-lista{min-height:0;overflow-y:auto;overscroll-behavior:contain;display:flex;flex-direction:column;gap:2px}
  #view .conversation-page-est .conv-painel-opcao{
    display:flex;align-items:flex-start;justify-content:space-between;gap:12px;width:100%;padding:10px 12px;cursor:pointer;
    border:0;border-radius:10px;background:none;color:var(--tinta);font:inherit;font-size:14px;line-height:1.35;text-align:left
  }
  #view .conversation-page-est .conv-painel-opcao[hidden]{display:none}
  #view .conversation-page-est .conv-painel-opcao > span{min-width:0;overflow-wrap:anywhere}
  #view .conversation-page-est .conv-painel-opcao > b{flex:none;font-size:13px;font-weight:600;color:var(--cinza)}
  #view .conversation-page-est .conv-painel-opcao:hover{background:var(--apoio)}
  #view .conversation-page-est .conv-painel-opcao.on{background:var(--terracota-fraco);color:var(--terracota);font-weight:600}
  #view .conversation-page-est .conv-painel-opcao.on > b{color:var(--terracota)}
  #view .conversation-page-est .conv-painel-vazio{margin:6px 12px 10px;font-size:13.5px;color:var(--cinza)}
  #view .conversation-page-est .conv-filtro-imovel-botao:focus-visible,#view .conversation-page-est .conv-filtro-limpar:focus-visible,
  #view .conversation-page-est .conv-painel-opcao:focus-visible{outline:3px solid var(--mostarda);outline-offset:1px}

  /* linhas da lista: foto, nome, horário, prévia, imóvel e não lidas — um pouco mais compactas */
  #view .conversation-page-est .conversation-row,#view .conversation-page-est .conversation-row:last-child{
    flex:none;border:0;border-radius:12px;padding:11px 12px;grid-template-columns:46px minmax(0,1fr);gap:12px;background:transparent
  }
  #view .conversation-page-est .conversation-row:hover{background:var(--apoio)}
  #view .conversation-page-est .conversation-row.ativa{background:var(--terracota-fraco);box-shadow:none}
  #view .conversation-page-est .conversation-row > .av{width:46px;height:46px;font-size:17px}
  #view .conversation-page-est .conversation-row-top strong{font-size:15px}
  #view .conversation-page-est .conversation-row-top time{font:12.5px 'Inter',sans-serif}
  #view .conversation-page-est .conversation-row-preview > span{font-size:13.5px}
  #view .conversation-page-est .conversation-row-property{margin-top:5px}
  #view .conversation-page-est .conversation-row-thumb{width:28px;height:26px}
  #view .conversation-page-est .conversation-row-property-copy strong{font-size:13px;max-width:none;flex:0 1 auto}
  #view .conversation-page-est .conversation-row-property-copy small{font-size:13px;max-width:none}
  #view .conversation-page-est .conversation-row-property.fallback{font-size:13px}

  /* sem conversa aberta: aviso no centro (horizontal e vertical) da área direita */
  #view .conversation-page-est .conversation-chat-column{min-height:0;min-width:0}
  #view .conversation-page-est .conversation-chat-column.vazia{align-items:stretch;justify-content:center}
  #view .conversation-page-est .conversation-chat-column.vazia > .conversation-chat-empty{flex:1;width:100%;height:100%;margin:0}
  #view .conversation-page-est .conversation-chat-empty strong{font-size:16px}
  #view .conversation-page-est .conversation-chat-empty p{font-size:13.5px;max-width:280px}

  /* conversa aberta: cabeçalho numa linha — pessoa | imóvel ... Ver anúncio; histórico rola; campo no rodapé */
  #view .conversation-page-est .chat-pane{height:100%;max-height:100%;min-height:0;max-width:none;border:0}
  #view .conversation-page-est .chat-imovel-pane{
    display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-rows:auto auto minmax(0,1fr) auto auto
  }
  #view .conversation-page-est .chat-imovel-pane > *{grid-column:1/-1}
  #view .conversation-page-est .chat-imovel-topo{display:contents}
  /* linha de base do cabeçalho: um item da grade atrás da 1ª linha (pessoa, imóvel e botão ficam por cima) */
  #view .conversation-page-est .chat-imovel-pane::before{content:"";grid-row:1;grid-column:1/-1;border-bottom:1px solid var(--linha)}
  #view .conversation-page-est .chat-imovel-pessoa,
  #view .conversation-page-est .chat-imovel-pane > .chat-imovel-contexto,
  #view .conversation-page-est .chat-imovel-ver{grid-row:1}
  #view .conversation-page-est .chat-imovel-pessoa{grid-column:1;gap:12px;padding:12px 20px 12px 28px;border-radius:0}
  #view .conversation-page-est .chat-imovel-pessoa .av{width:44px;height:44px;font-size:17px;background:#F6E7D2;color:var(--terracota);font-weight:800}
  #view .conversation-page-est .chat-imovel-pessoa strong{font-size:16px}
  #view .conversation-page-est .chat-imovel-pessoa small{font-size:13px;color:var(--cinza)}
  #view .conversation-page-est .chat-imovel-pane > .chat-imovel-contexto{
    grid-column:2;padding:12px 0 12px 22px;gap:14px;border-bottom:0;
    background:linear-gradient(#e8e3db,#e8e3db) left center/1px 40px no-repeat
  }
  #view .conversation-page-est .chat-imovel-contexto .conv-imovel-foto{width:60px;height:46px;border-radius:9px}
  #view .conversation-page-est .chat-imovel-contexto strong{font-size:15px}
  #view .conversation-page-est .chat-imovel-contexto small{font-size:13px;margin-top:2px}
  #view .conversation-page-est .chat-imovel-ver{
    grid-column:3;align-self:center;margin:0 28px 0 12px;padding:9px 18px;
    border:1.5px solid var(--terracota);border-radius:11px;background:var(--papel);color:var(--terracota);font-size:14px
  }
  #view .conversation-page-est .chat-imovel-ver:hover{background:var(--terracota-fraco)}
  #view .conversation-page-est .chat-topo:not(.chat-imovel-topo){padding:12px 28px}
  /* conversa pessoa a pessoa: mesma escala do cabeçalho da conversa por imóvel (o nome tem estilo inline de 14px) */
  #view .conversation-page-est .chat-perfil{gap:12px}
  #view .conversation-page-est .chat-perfil .av{width:44px;height:44px;font-size:17px;background:#F6E7D2;color:var(--terracota);font-weight:800}
  #view .conversation-page-est .chat-perfil .item-t{font-size:16px!important}
  #view .conversation-page-est .chat-perfil .chat-tipo{font-size:13px;color:var(--cinza)}

  #view .conversation-page-est .chat-aviso{padding:0}
  #view .conversation-page-est .chat-aviso .aviso{
    justify-content:center;align-items:center;border:0;border-radius:0;background:var(--terracota-fraco);color:var(--tinta);
    font-size:13.5px;padding:9px 24px
  }
  #view .conversation-page-est .chat-aviso .aviso svg{color:var(--terracota);margin:0}
  /* histórico: ocupa o espaço entre o aviso e o campo; poucas mensagens ficam junto do campo (como nos apps de
     mensagem), muitas rolam por dentro. margin-top:auto no 1º item mantém a rolagem até o topo funcionando. */
  #view .conversation-page-est .msgs{min-height:0;overflow-y:auto;padding:20px 28px 12px;gap:10px}
  #view .conversation-page-est .msgs > :first-child{margin-top:auto}
  #view .conversation-page-est .msg{font-size:15px;padding:10px 15px;max-width:min(70%,560px)}
  #view .conversation-page-est .msg.dele{background:#F3EEE7;border-radius:16px 16px 16px 6px}
  #view .conversation-page-est .msg.meu{border-radius:16px 16px 6px 16px}
  #view .conversation-page-est .msg .hr{font-size:11.5px;margin-top:5px}
  #view .conversation-page-est .msg.meu .hr{text-align:right}
  #view .conversation-page-est .chat-sug{flex:none;padding:0 28px}
  #view .conversation-page-est .chat-sug .pills{margin-bottom:8px!important}
  #view .conversation-page-est .chat-sug .pill{
    background:var(--papel);border:1px solid var(--linha);color:var(--tinta);font-size:13.5px;font-weight:600;
    padding:8px 16px;border-radius:20px;margin-bottom:2px
  }
  #view .conversation-page-est .chat-sug .pill:hover{border-color:var(--terracota)}
  #view .conversation-page-est .compor{flex:none;border-top:0;padding:8px 28px 18px;gap:12px}
  #view .conversation-page-est .compor input{min-height:48px;border-radius:24px;padding:0 20px;font-size:15px}
  #view .conversation-page-est .enviar{width:48px;height:48px;font-size:20px}
}
/* notebooks (900–1199px): a coluna da lista é estreita; o ícone do botão sai para o rótulo caber inteiro */
@media (min-width:900px) and (max-width:1199px){
  #view .conversation-page-est .conversation-filters{padding-left:16px;padding-right:16px}
  #view .conversation-page-est .conv-filtro-imovel-botao > svg:first-child{display:none}
  #view .conversation-page-est .conv-filtro-imovel-botao{padding:7px 11px}
}
