/* Agente agrônomo (chat de IA): botão fixo e painel de conversa. Mesmos tokens do app.css. */
.agent{cursor:pointer}
.chat-fab{position:fixed;left:calc(420px - 22px);transform:translateX(-100%);bottom:22px;z-index:1200;display:inline-flex;align-items:center;gap:8px;min-height:52px;padding:12px 20px 12px 16px;border:0;border-radius:99px;background:var(--ink);color:#fff;font-weight:700;font-size:16px;box-shadow:0 8px 24px #10241b4d;cursor:pointer}
.chat-fab svg{width:20px;height:20px;color:var(--leaf)}.chat-fab:hover{background:var(--ink2)}
.chat{position:fixed;left:0;top:0;bottom:0;width:420px;z-index:1300;display:flex;flex-direction:column;background:var(--straw);border-right:1px solid var(--line);box-shadow:8px 0 32px #10241b33}
.chat header{display:flex;align-items:center;gap:10px;padding:14px 14px 12px 16px;background:var(--ink);color:#fff;position:relative}
.chat header:after{content:'';position:absolute;left:0;right:0;bottom:0;height:4px;background:var(--ndvi)}
.chat header .av{flex:none;width:36px;height:36px;border-radius:11px;background:#ffffff14;display:grid;place-items:center;color:var(--leaf)}.chat header .av svg{width:20px;height:20px}
.chat header .grow{flex:1;min-width:0}.chat header b{display:block;font-family:var(--display);font-weight:700;font-size:18px;letter-spacing:-.01em;line-height:1.15}.chat header small{display:block;font-size:13px;color:#b9cdbf;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-x{flex:none;background:#ffffff14;border:0;color:#fff;border-radius:10px;min-height:40px;padding:6px 11px;font-size:13px;font-weight:700;cursor:pointer}.chat-x.close{width:40px;padding:0;font-size:24px;line-height:1}
.chat-log{flex:1;overflow:auto;padding:16px 16px 8px;display:flex;flex-direction:column;gap:10px;min-height:0}
.msg{max-width:92%;font-size:15.5px;line-height:1.5;padding:11px 14px;border-radius:var(--r);overflow-wrap:anywhere}
.msg p{margin:0 0 6px}.msg p:last-child{margin-bottom:0}.msg ul,.msg ol{margin:4px 0 6px;padding-left:20px}.msg li{margin:2px 0}
.msg small{display:block;margin-top:6px;font-size:12.5px;color:var(--muted)}
.msg.me{align-self:flex-end;background:var(--soy);color:#fff;border-bottom-right-radius:4px}.msg.me small{color:#d6ead2}
.msg.bot{align-self:flex-start;background:var(--paper);border:1px solid var(--line);border-top-left-radius:4px}
.msg.bot.err{background:var(--soil-bg);border-color:#e7c3b4;color:var(--soil)}
.msg.typing{display:flex;align-items:center;gap:5px}.msg.typing i{width:7px;height:7px;border-radius:50%;background:var(--soy);animation:pulse 1.2s ease-in-out infinite}.msg.typing i:nth-child(2){animation-delay:.2s}.msg.typing i:nth-child(3){animation-delay:.4s}.msg.typing small{margin:0 0 0 6px}
@media (prefers-reduced-motion:reduce){.msg.typing i{animation:none}}
.chat-foot{padding:8px 14px calc(12px + env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--straw)}
.chat-chips{display:flex;gap:8px;overflow-x:auto;padding:2px 0 10px;scrollbar-width:none}.chat-chips::-webkit-scrollbar{display:none}
.chat-chips button{flex:none;min-height:40px;padding:8px 13px;border-radius:99px;border:1.5px solid var(--line);background:var(--paper);font-size:14px;font-weight:700;color:var(--ink2);cursor:pointer;white-space:nowrap}.chat-chips button:hover{border-color:var(--soy)}.chat-chips button:disabled{opacity:.5;cursor:default}
.chat-form{display:flex;gap:8px;align-items:flex-end}
.chat-form textarea{flex:1;min-height:48px;max-height:140px;resize:none;padding:12px 13px;line-height:1.35}
.chat-send{flex:none;width:52px;height:52px;border:0;border-radius:14px;background:var(--soy);color:#fff;display:grid;place-items:center;cursor:pointer}.chat-send svg{width:22px;height:22px}.chat-send:disabled{opacity:.45;cursor:default}
.chat-notice{margin:8px 2px 0;font-size:12px;color:var(--muted);line-height:1.4}
@media (max-width:820px){
 .chat-fab{left:auto;right:14px;transform:none;bottom:calc(var(--nav) + env(safe-area-inset-bottom) + 14px)}
 .demo-flag~.chat-fab,body:has(.demo-flag) .chat-fab{bottom:calc(var(--nav) + env(safe-area-inset-bottom) + 44px)}
 .chat{left:0;right:0;width:auto;top:auto;height:min(88dvh,100%);border:0;border-radius:18px 18px 0 0;overflow:hidden;box-shadow:0 -8px 32px #10241b40;z-index:1300}
 body.chat-open{overflow:hidden}body.chat-open .demo-flag{display:none}
}
