.ai-chat{position:absolute;right:16px;bottom:88px;z-index:30;width:min(390px,calc(100% - 24px));max-width:calc(100% - 24px);height:min(590px,calc(100% - 100px));min-height:min(420px,calc(100% - 100px));display:flex;flex-direction:column;overflow:hidden;border:1px solid var(--tb-color-chat-border, #dcebe0);border-radius:var(--tb-card-radius, 14px);background:var(--tb-color-surface-soft, #f9fcf8);color:var(--tb-color-deep, #20563c);box-shadow:0 8px 28px #15462d29;font-family:var(--tb-font-body, "DM Sans", system-ui, sans-serif)}.ai-chat[hidden],.image-preview[hidden],.image-action-sheet[hidden],.scan-camera-view[hidden],.scan-image-button[hidden]{display:none}.chat-launcher{position:absolute;left:0;top:0;width:52px;height:52px;display:grid;place-items:center;border:0;border-radius:50%;background:var(--tb-color-action, #25865f);color:#fff;box-shadow:0 4px 14px #15462d4d;font-size:28px;cursor:pointer;z-index:9998;touch-action:none;user-select:none;-webkit-user-select:none;opacity:1;visibility:visible}.chat-launcher:hover{background:var(--tb-color-action-hover, #176044)}.chat-launcher:focus-visible{outline:2px solid var(--tb-color-accent, #91d45e);outline-offset:3px}.chat-header{display:flex;align-items:center;gap:9px;padding:17px 14px 14px;background:linear-gradient(135deg,var(--tb-color-chat-header-start, #1f7654),var(--tb-color-chat-header-end, #075038));color:#fff}.chat-header>button{width:40px;height:40px;flex:0 0 40px;border:0;background:transparent;color:#fff;font-size:25px;line-height:1;cursor:pointer}.chat-header>button:last-child{margin-left:auto;font-size:23px}.chat-header strong,.chat-header small{display:block}.chat-header strong{font-size:13px}.chat-header small{margin-top:2px;color:#cbe6d4;font-size:10px}.chat-avatar,.welcome-avatar,.message-avatar{display:grid;place-items:center;border-radius:50%;background:var(--tb-color-accent, #91d45e);color:var(--tb-color-deep, #20563c);object-fit:cover}.chat-avatar{width:28px;height:28px;flex:0 0 28px;font-size:16px}.chat-content{flex:1;min-height:0;overflow:auto;padding:28px 14px 18px;background:linear-gradient(180deg,#f1f9f1,#fbfdfb)}.chat-welcome{display:flex;gap:10px;padding:16px 13px;border-radius:15px;background:var(--tb-color-light, #e3f1df);box-shadow:0 5px 12px #2869440d}.welcome-avatar{width:42px;height:42px;flex:0 0 42px;font-size:24px}.chat-welcome strong{font-size:13px}.chat-welcome p{margin:6px 0 0;color:#407660;font-size:11px;line-height:1.55}.chat-topics{display:flex;gap:7px;margin-top:10px;overflow:auto;padding-bottom:3px}.chat-topics button{min-height:36px;padding:9px 12px;border:0;border-radius:var(--tb-pill-radius, 999px);background:var(--tb-color-light, #e3f1df);color:#277151;font-size:11px;white-space:nowrap;cursor:pointer}.chat-empty{display:flex;min-height:220px;flex-direction:column;align-items:center;justify-content:center;color:#76af8c;text-align:center}.chat-empty>span{font-size:36px}.chat-empty strong{margin-top:8px;font-size:15px}.chat-empty p{max-width:245px;margin:6px 0;color:#99aaa0;font-size:11px;line-height:1.5}.suggested-questions{padding:14px 9px 8px;border-radius:18px;background:#ffffffb8}.suggested-questions>div{display:flex;align-items:center;justify-content:space-between;padding:0 4px 8px}.suggested-questions strong{font-size:13px}.suggested-questions>div span{font-size:9px;font-weight:700}.suggested-questions button{display:flex;align-items:center;gap:9px;width:100%;margin-top:5px;padding:10px;border:0;border-radius:12px;background:#e9f6e9;color:#277151;font-size:11px;text-align:left;cursor:pointer}.suggested-questions button span{flex:1}.chat-message{display:flex;align-items:flex-start;gap:7px;margin:14px 0}.chat-message.user,.chat-message.image{justify-content:flex-end}.chat-message p{max-width:78%;margin:0;padding:10px 12px;border-radius:14px;background:var(--tb-color-light, #e3f1df);color:var(--tb-color-deep, #20563c);font-size:13px;line-height:1.5;white-space:pre-wrap;overflow-wrap:anywhere}.chat-message.user p{border-top-right-radius:4px;background:var(--tb-color-action-hover, #176044);color:#fff}.message-avatar{width:25px;height:25px;flex:0 0 25px;font-size:13px}.chat-composer{display:flex;flex:0 0 auto;align-items:center;gap:8px;padding:10px 14px 20px;border-top:1px solid var(--tb-color-border, #dfe8df);background:var(--tb-color-surface-soft, #f9fcf8)}.image-input{display:none}.chat-composer button{display:grid;width:40px;height:40px;flex:0 0 40px;place-items:center;border:0;border-radius:50%;background:var(--tb-color-action, #25865f);color:#fff;font-size:19px;cursor:pointer}.chat-composer button:last-child{font-size:14px}.chat-composer input{min-width:0;height:var(--tb-control-height, 44px);flex:1;padding:0 14px;border:1px solid var(--tb-color-chat-border, #dcebe0);border-radius:20px;outline:0;background:#fff;color:#315c48;font-size:12px}.chat-composer input:focus{border-color:var(--tb-color-action, #25865f)}.chat-controls{display:grid;gap:8px;padding:10px 12px;border-bottom:1px solid #e4eee5;background:#fff}.chat-history-controls{display:flex;align-items:center;gap:6px}.chat-history-controls select,.chat-plant-controls select{min-width:0;height:34px;border:1px solid #d5e6d8;border-radius:9px;background:#fff;color:#315c48;font:inherit}.chat-history-controls select{flex:1;padding:0 8px;font-size:11px}.chat-history-controls button,.chat-retry{min-height:32px;padding:0 10px;border:1px solid #cfe3d2;border-radius:9px;background:#eff8ef;color:#246746;font-size:11px;font-weight:700;cursor:pointer}.chat-history-controls button:disabled,.chat-composer button:disabled,.chat-history-controls select:disabled,.chat-plant-controls select:disabled{opacity:.55;cursor:not-allowed}.chat-plant-controls{display:flex;align-items:center;gap:8px;color:#527762;font-size:10px}.chat-plant-controls label{flex:0 0 auto;font-weight:700}.chat-plant-controls label small{color:#829589;font-weight:400}.chat-plant-controls select{flex:1;padding:0 8px;font-size:10px}.chat-message-error p{background:#fff0ed;color:#8b3c2d}.chat-retry{align-self:flex-end;margin:3px 0 0 32px;background:#fff}.chat-loading p{color:#527762}.chat-loading p:after{display:inline-block;width:1.4em;content:"";animation:chat-loading-dots 1.2s steps(4,end) infinite}@keyframes chat-loading-dots{0%{content:""}25%{content:"."}50%{content:".."}75%,to{content:"..."}}.chat-composer input:disabled{background:#f0f3f0}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.image-preview{display:flex;align-items:center;gap:8px;padding:8px 14px;border-top:1px solid var(--tb-color-border, #dfe8df);background:var(--tb-color-surface-soft, #f9fcf8);color:#47745d;font-size:11px}.image-preview img{width:42px;height:42px;border-radius:8px;object-fit:cover}.image-preview span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.image-preview button{width:40px;height:40px;flex:0 0 40px;border:0;border-radius:50%;background:#e4efe5;color:#387252;font-size:16px;cursor:pointer}.sent-plant-image{width:min(68%,210px);max-height:180px;border:2px solid #d7ecd8;border-radius:14px 14px 4px;object-fit:cover}.scan-image-button{width:auto!important;height:31px!important;flex-basis:auto!important;padding:0 10px;border-radius:16px!important;font-size:9px!important;white-space:nowrap}.image-action-sheet{position:absolute;right:14px;bottom:68px;left:14px;z-index:2;padding:12px;border:1px solid #dcebe0;border-radius:14px;background:#fff;box-shadow:0 8px 22px #184b2f29}.image-action-sheet>strong{display:block;margin:0 4px 8px;color:#285d45;font-size:11px}.image-action-sheet>button{display:grid;width:100%;grid-template-columns:28px 1fr;column-gap:8px;padding:9px 6px;border:0;border-radius:9px;background:transparent;color:#2d7652;text-align:left;cursor:pointer}.image-action-sheet>button:hover{background:#edf8ee}.image-action-sheet>button span{display:grid;width:25px;height:25px;grid-row:span 2;place-items:center;border-radius:50%;background:#dff2df;font-size:16px}.image-action-sheet>button b{font-size:10px}.image-action-sheet>button small{margin-top:2px;color:#81968a;font-size:8px}.scan-camera-view{display:flex;flex:1;flex-direction:column;padding:14px;background:#f1f9f1}.scan-camera-back{align-self:flex-start;border:0;background:none;color:#286a4c;font-size:11px;cursor:pointer}.scan-camera-frame{display:flex;min-height:0;flex:1;align-items:center;justify-content:center;margin:12px 0;overflow:hidden;border:2px solid #b9dfbd;border-radius:16px;background:#10271b}.scan-camera-frame video,.scan-camera-frame img{width:100%;height:100%;min-height:0;object-fit:cover}.capture-photo-button,.send-photo-button{width:100%;padding:12px;border:0;border-radius:22px;background:#21865e;color:#fff;font-size:12px;font-weight:700;cursor:pointer}.capture-photo-button:before{content:"◉ ";font-size:15px}.send-photo-button{background:#176044}@media (max-width: 480px){.ai-chat{right:12px;bottom:calc(148px + env(safe-area-inset-bottom,0px));width:calc(100% - 24px);max-width:390px;height:min(590px,calc(100dvh - 162px - env(safe-area-inset-bottom,0px)));min-height:min(340px,calc(100dvh - 162px - env(safe-area-inset-bottom,0px)))}.chat-composer{padding-bottom:calc(10px + env(safe-area-inset-bottom,0px))}.chat-history-controls button{padding:0 8px}}@media (max-height: 620px){.ai-chat{height:calc(100% - 72px);min-height:280px}}
