/* home-duostone.css — Início (usuário logado): paleta Jatobase em verde / bege claro / marrom, mais branco e verde.
   Carregar DEPOIS de index.css. Tudo escopado em html.usuario-logado (.home-logado e .hl-nav): não afeta visitante nem outras telas.
   Verde ÚNICO do site: #235048 (sem outros tons de verde; áreas claras usam só transparência dele). */

html.usuario-logado:not([data-theme="dark"]),
html.usuario-logado:not([data-theme="dark"]) body { background: #fff; }
html.usuario-logado:not([data-theme="dark"]) { --header-bg: rgba(255, 255, 255, .92); }

html.usuario-logado .home-logado,
html.usuario-logado .hl-nav {
  --accent: #235048; --accent-dark: #235048;
  --accent-light: rgba(35, 80, 72, .10); --accent-medium: rgba(35, 80, 72, .18);
  --verde-claro: rgba(35, 80, 72, .10); --bege: #F1E7DA; --emerald: #235048;
  font-family: 'Manrope', 'Inter', sans-serif;
}
html.usuario-logado[data-theme="dark"] .home-logado,
html.usuario-logado[data-theme="dark"] .hl-nav {
  --accent: #F5EFE6; --accent-dark: #F5EFE6;
  --accent-light: rgba(245, 239, 230, .10); --accent-medium: rgba(245, 239, 230, .18);
  --verde-claro: rgba(35, 80, 72, .60); --bege: rgba(241, 231, 218, .10); --emerald: #235048;
}

/* ===== Boas-vindas ===== */
.home-logado .hl-boas-vindas { margin: 0 0 16px; }
.home-logado .hl-boas-vindas h1 { color: var(--accent-dark); font-size: 26px; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; }
.home-logado .hl-boas-vindas .emoji-aceno { display:inline-block; margin-right:.12em; font-size:.88em; transform-origin:70% 70%; animation:emoji-aceno 1.8s ease-in-out infinite; }
@keyframes emoji-aceno { 0%,60%,100% { transform:rotate(0); } 10%,30%,50% { transform:rotate(18deg); } 20%,40% { transform:rotate(-10deg); } }
@media (prefers-reduced-motion: reduce) { .home-logado .hl-boas-vindas .emoji-aceno { animation:none; } }
.home-logado .hl-boas-vindas p { margin-top: 6px; font-size: 15px; color: var(--ink-mute); }
/* Mobile: vírgula fecha a 1ª linha e o nome vai para a 2ª */
@media (max-width: 600px) {
  .home-logado .hl-boas-vindas h1 #hl-nome:not(:empty)::before { content: ',\A'; white-space: pre; }
}

/* ===== Card principal: Sua coleção ===== */
.hl-colecao { position: relative; display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: 24px; color: #fff;
  background-color: #235048; background-image: linear-gradient(to top, #235048 0%, rgba(35, 80, 72, .92) 12%, rgba(35, 80, 72, .48) 30%, rgba(35, 80, 72, 0) 52%), url('https://akajfkthxcouvdplpnlx.supabase.co/storage/v1/object/public/ilustracoes/explorador_colecao.png');
  background-repeat: no-repeat; background-position: right 14px center; background-size: auto 86%; box-shadow: 0 14px 30px rgba(35, 80, 72, .25); }
.hl-col-topo { display: flex; align-items: center; gap: 14px; }
.hl-col-info { display: flex; flex: 1; min-width: 0; max-width: 70%; flex-direction: column; }
.hl-col-rotulo { font-size: 13px; font-weight: 700; color: rgba(255, 255, 255, .82); }
.hl-col-valor { display: block; margin-top: 4px; font-size: 32px; line-height: 1.05; font-weight: 800; letter-spacing: -.03em; color: #fff; overflow-wrap: anywhere; }
.hl-col-valor.vazio { font-size: 22px; line-height: 1.15; letter-spacing: -.02em; }
.hl-col-sub { margin-top: 8px; font-size: 14px; line-height: 1.45; color: rgba(255, 255, 255, .92); }
.hl-col-botao { display: flex; width: 100%; height: 50px; align-items: center; justify-content: center; gap: 6px; border: 0 !important; border-radius: 999px;
  background: #fff !important; color: #235048 !important; font: 800 15px 'Manrope', 'Inter', sans-serif; cursor: pointer; }
.hl-col-botao svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

/* Faixa de imagem carregada: compacta e alinhada ao card da coleção. */
.home-logado .hl-foto-carregada {
  display: flex; min-width: 0; height: 58px; align-items: center; gap: 10px;
  margin-top: 14px; box-sizing: border-box; position: relative; z-index: 1;
  padding: 6px 10px 6px 8px; border-radius: 999px; color: #fff; background: var(--emerald);
  box-shadow: 0 8px 18px rgba(35, 80, 72, .18);
}
.hl-foto-trocar { position: relative; display: block; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.8); border-radius: 50%; background: var(--emerald); }
.hl-foto-fundo, .hl-foto-miniatura { position: absolute; inset: 0; display: block; width: 100%; height: 100%; border-radius: 50%; }
.hl-foto-fundo { object-fit: cover; filter: blur(5px); transform: scale(1.2); opacity: .8; }
.hl-foto-miniatura { z-index: 1; object-fit: contain; }
.hl-foto-atualizar { position: absolute; z-index: 2; right: -1px; bottom: -1px; display: grid; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: #fff; color: var(--emerald); font: 700 13px/1 'Manrope', 'Inter', sans-serif; }
.hl-foto-textos { display: flex; min-width: 0; flex: 1; flex-direction: column; gap: 1px; line-height: 1.2; }
.hl-foto-textos strong { overflow: hidden; font-size: 13px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.hl-foto-textos span { color: rgba(255,255,255,.78); font-size: 11px; }
.hl-foto-escanear { display: flex; flex: 0 0 auto; min-width: 90px; height: 36px; align-items: center; justify-content: center; gap: 5px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--card); color: var(--emerald); font: 800 13px 'Manrope', 'Inter', sans-serif; cursor: pointer; }
.hl-foto-cancelar { display: grid; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: rgba(255,255,255,.16); color: #fff; cursor: pointer; }
.hl-foto-cancelar svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.hl-foto-cancelar:active { background: rgba(255,255,255,.3); }
.hl-foto-escanear:disabled { cursor: wait; opacity: .72; }
html[data-theme="dark"] .hl-foto-escanear { background: var(--ink-light); color: var(--emerald); }
@media (min-width: 960px) {
  .home-logado .hl-foto-carregada { grid-column: 1 / span 5; grid-row: 3; margin-top: 0; }
}

/* ===== Histórico ===== */
.home-logado .hl-section { margin-top: 18px; }
.home-logado .hl-section-head h2 { color: var(--accent-dark); font-size: 18px; font-weight: 800; letter-spacing: -.02em; }
.home-logado .hl-history-link { font-size: 14px; font-weight: 800; }
.home-logado .hl-historico-lista { border-radius: 20px; }
.home-logado .hl-historico-item { gap: 12px; padding: 12px 14px; }
.home-logado .hl-historico-pedra { width: 52px; height: 52px; border-radius: 14px;
  background: #235048 !important; color: #fff !important; }
.home-logado .hl-historico-pedra svg { width: 22px; height: 22px; }
.home-logado .hl-historico-copy strong { font-size: 16px; font-weight: 800; }
.home-logado .hl-historico-copy small { font-size: 13px; }
.home-logado .hl-historico-valor { flex: none; font-size: 15px; font-weight: 800; color: var(--accent); }
.home-logado .hl-historico-valor.sem-valor { font-size: 13px; font-weight: 700; color: var(--ink-mute); }
.home-logado .hl-historico-seta { display: none; }

/* ===== Cards de curiosidades / plantas na mesma paleta (sem roxo, rosa ou azul) ===== */
.home-logado .hl-curio-icone,
.home-logado .hl-curio-icone.azul,
.home-logado .hl-curio-icone.verde,
.home-logado .hl-curio-icone.violeta { background: var(--verde-claro) !important; color: var(--accent) !important; }
.home-logado .hl-curio-icone.rosa,
.home-logado .hl-curio-icone.dourado { background: var(--bege) !important; color: #7A3B24 !important; }
html.usuario-logado[data-theme="dark"] .home-logado .hl-curio-icone.rosa,
html.usuario-logado[data-theme="dark"] .home-logado .hl-curio-icone.dourado { color: #E3D9C8 !important; }

/* ===== Menu de baixo: Início · Histórico · [Escanear] · Conta · Comunidade (todas as larguras) ===== */
@media all {
  html.usuario-logado body { padding-bottom: calc(80px + env(safe-area-inset-bottom)); }
  .hl-nav { height: calc(72px + env(safe-area-inset-bottom)); align-items: stretch; justify-content: space-between; padding: 0 2px env(safe-area-inset-bottom);
    background: #fff; border-top: 1px solid var(--line); box-shadow: none; }
  html.usuario-logado[data-theme="dark"] .hl-nav { background: #2E1F17; }
  .hl-nav-item { position: relative; min-width: 0; justify-content: flex-end; gap: 4px; padding: 0 0 11px; white-space: nowrap;
    color: var(--ink-mute) !important; font: 700 11px/1 'Manrope', 'Inter', sans-serif; letter-spacing: -.01em; }
  .hl-nav-item svg { width: 24px; height: 24px; }
  .hl-nav-item.ativo { color: var(--accent) !important; font-weight: 800; }
  .hl-nav-scan { flex: 0 0 84px; color: var(--accent) !important; font-weight: 800; }
  .hl-nav-circ { position: absolute; top: -31px; left: 50%; transform: translateX(-50%); display: flex; width: 62px; height: 62px; align-items: center; justify-content: center;
    border: 5px solid #fff; border-radius: 50%; background: #235048; color: #fff; box-shadow: 0 6px 16px rgba(35, 80, 72, .30); }
  html.usuario-logado[data-theme="dark"] .hl-nav-circ { border-color: #2E1F17; }
  .hl-nav-scan .hl-nav-circ svg { width: 28px; height: 28px; stroke-width: 2.1; }
  .hl-nav-circ circle { fill: currentColor; stroke: none; }
}

/* ===== Fotos reais (home logada) ===== */
/* Histórico: foto da pedra avaliada no lugar do quadrado colorido */
.home-logado .hl-historico-pedra { overflow: hidden; }
.home-logado .hl-historico-pedra > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.home-logado .hl-historico-pedra.com-foto > svg { display: none; }
/* Em telas estreitas, reserva largura para o explorador sem apertar o valor da coleção. */
@media (max-width: 480px) {
  .hl-colecao { background-position: right 6px center; background-size: auto 76%; }
  .hl-col-info { max-width: calc(100% - 68px); }
}
/* "Você sabia?" e "Pedras famosas": foto de referência no topo do card, no lugar do ícone */
.home-logado .hl-curio-foto { display: block; width: 100%; height: 86px; margin-bottom: 2px; border-radius: 12px; object-fit: cover; background: var(--verde-claro); }
.home-logado .hl-curio-card.com-foto > .hl-curio-icone { display: none; }
/* Detector de plantas: ilustração da home de visitante */
.hl-planta-ilustra { display: flex; justify-content: center; margin: -4px -4px 0; border-radius: 12px; background: #fff; overflow: hidden; }
.hl-planta-ilustra img { display: block; width: 100%; max-width: 280px; height: 130px; object-fit: contain; }
html[data-theme="dark"] .hl-planta-ilustra { background: #F5F1E8; }

/* Menu de baixo estável no scroll (celular): camada própria e sem overflow-x:hidden no body, que faz fixed "tremer" em iOS/Android */
@media (max-width: 600px) {
  html.usuario-logado .hl-nav { transform: translateZ(0); -webkit-transform: translateZ(0); backface-visibility: hidden; }
}
@supports (overflow: clip) {
  html.usuario-logado body { overflow-x: clip; }
}

/* Firefox (celular): se a barra de endereço some ao rolar e sobra um vazio sob o menu, a cor do menu preenche esse vazio */
@media (max-width: 600px) {
  @supports (-moz-appearance: none) {
    html.usuario-logado .hl-nav::after { content: ''; position: absolute; left: 0; right: 0; top: 100%; height: 160px; background: inherit; pointer-events: none; }
  }
}

/* Menos espaço vazio abaixo do "Detector de plantas": o body já reserva a altura do menu de baixo, então o home-logado não precisa somar mais 88px */
html.usuario-logado .home-logado { padding-bottom: 12px; }
/* O chat ocupa a tela inteira: recolhe a navegação global para não cobrir o composer nem os controles do chat. */
html.usuario-logado.chat-aberto .hl-nav { display: none !important; }

/* ===== Faixa "Foto pronta": visual de app ===== */
.home-logado .hl-foto-carregada {
  height: auto; min-height: 80px; gap: 12px; padding: 10px 12px 10px 10px; border-radius: 28px;
  background: linear-gradient(135deg, #2b5f55 0%, #235048 55%, #1d4139 100%);
  box-shadow: 0 12px 26px rgba(35, 80, 72, .28), inset 0 1px 0 rgba(255,255,255,.12);
}
.hl-foto-trocar { flex: 0 0 60px; width: 60px; height: 60px; border: 0; background: transparent;
  box-shadow: 0 0 0 2px rgba(255,255,255,.95), 0 0 0 5px rgba(255,255,255,.18), 0 6px 14px rgba(0,0,0,.25); }
.hl-foto-textos { gap: 3px; }
.hl-foto-textos strong { display: flex; align-items: center; gap: 6px; font-size: 15px; letter-spacing: -.01em; }
.hl-foto-check { display: inline-grid; flex: none; width: 18px; height: 18px; place-items: center; border-radius: 50%;
  background: #7ee2b8; color: #164038; font: 800 11px/1 'Manrope', 'Inter', sans-serif; font-style: normal; }
.hl-foto-textos span { font-size: 12px; color: rgba(255,255,255,.72); }
.hl-foto-escanear { height: 42px; min-width: 0; padding: 0 16px; gap: 4px; font-size: 14px;
  box-shadow: 0 4px 12px rgba(0,0,0,.18); }
.hl-foto-escanear span:last-child { font-size: 18px; line-height: 1; margin-top: -1px; }
.hl-foto-cancelar { flex: 0 0 34px; width: 34px; height: 34px; background: rgba(255,255,255,.14); }
.hl-foto-cancelar svg { width: 15px; height: 15px; }
@media (max-width: 360px) {
  .home-logado .hl-foto-carregada { gap: 8px; padding-right: 10px; }
  .hl-foto-trocar { flex-basis: 52px; width: 52px; height: 52px; }
  .hl-foto-escanear { padding: 0 12px; }
}


/* Menu inferior alinhado: o botão de escanear ocupa a mesma linha dos demais ícones. */
@media (max-width: 600px) {
  html.usuario-logado body {
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  }
  html.usuario-logado .hl-nav {
    box-sizing: border-box;
    height: calc(78px + env(safe-area-inset-bottom, 0px));
    align-items: stretch;
    padding: 5px 4px calc(7px + env(safe-area-inset-bottom, 0px));
  }
  html.usuario-logado .hl-nav .hl-nav-item {
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 2px 2px;
  }
  html.usuario-logado .hl-nav .hl-nav-scan,
  html.usuario-logado .hl-nav .hl-nav-scan.ativo {
    flex: 1 1 0;
    margin: 0;
    border-radius: 0;
    background: transparent !important;
    color: var(--ink-mute) !important;
    box-shadow: none;
    transform: none;
  }
  html.usuario-logado .hl-nav .hl-nav-scan.ativo { color: var(--accent) !important; }
  html.usuario-logado .hl-nav .hl-nav-scan .hl-nav-circ {
    position: static;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    box-shadow: none;
    transform: none;
  }
  html.usuario-logado .hl-nav .hl-nav-scan .hl-nav-circ .hl-ico-scan {
    display: block;
    width: 23px;
    height: 23px;
    stroke-width: 1.8;
  }
}

/* Modais de foto usam a tela toda; a navegação fixa não deve cobrir a folha. */
html.usuario-logado.modal-foto-aberto .hl-nav { display: none !important; }
