
/* One scroll surface for the conversation; the composer never shrinks. */
.kb-chat-log{overflow-anchor:none;scroll-behavior:auto;-webkit-overflow-scrolling:touch}
.kb-chat-log>*{flex-shrink:0}
.kb-compose input{font-size:16px;min-height:52px;scroll-margin:0}
.kb-compose button{touch-action:manipulation}
.kb-latest{display:block;margin:8px auto;min-height:44px;padding:8px 18px;border-radius:24px;background:#e4d7f8;color:#563682;font-weight:650}
.kb-latest[hidden]{display:none}
.kb-has-conversation>.kb-prompts{display:none}
.kb-chat-active{position:fixed!important;z-index:1000;top:var(--chat-top,0);left:var(--chat-left,0);width:var(--chat-width,100vw);height:var(--chat-height,100dvh);max-width:none;margin:0!important;border:0;border-radius:0;padding:0 12px;display:flex;flex-direction:column;gap:8px;overflow:hidden;overscroll-behavior:none;box-sizing:border-box;background:#f1ebf9}
.kb-chat-active>.kb-chat-bar{display:flex;align-items:center;gap:12px;flex:none;padding-top:env(safe-area-inset-top,0px);min-height:52px}
.kb-chat-bar button{min-width:64px;min-height:44px;color:#7049a3;background:transparent;text-align:start;font-size:16px}
.kb-chat-bar strong{font-size:16px;line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.kb-chat-active>h2,.kb-chat-active>.kb-section-heading,.kb-chat-active>.kb-agent-status{display:none}
.kb-chat-active>.kb-chat-log{flex:1;min-height:0;height:auto;margin:0;padding:12px;border-radius:16px}
.kb-chat-active>.kb-prompts{flex:none;flex-wrap:nowrap;overflow-x:auto;margin:0;gap:8px;max-height:48px}
.kb-chat-active>.kb-prompts button{flex:none;white-space:nowrap;padding:8px 12px;font-size:13px}
.kb-chat-active>.kb-compose{flex:none;margin:0;padding:4px 0 max(8px,env(safe-area-inset-bottom,0px));align-items:center;background:#f1ebf9}
.kb-chat-active .kb-compose input{width:0;height:52px;padding:12px;border-radius:16px}
.kb-chat-active .kb-compose button{width:52px;min-height:52px;height:52px;padding:8px;border-radius:16px}
.kb-chat-active>#live-chat-status:empty{display:none}
.kb-chat-active>#live-chat-status{flex:none;margin:0;font-size:13px;max-height:44px;overflow:auto}
.kb-chat-active>.kb-latest{flex:none;margin:0 auto}
@media(max-width:650px){.kb-test>.kb-prompts{flex-wrap:nowrap;overflow-x:auto}.kb-test>.kb-prompts button{flex:none;white-space:nowrap}.kb-test .kb-chat-log{height:min(420px,52svh)}.kb-chat-active .kb-chat-log{height:auto}}

.kb-test>h2{font-size:clamp(22px,3.5vw,28px);line-height:1.2;letter-spacing:-.5px;margin:0 0 16px}

.kb-chat-bar strong{white-space:normal;overflow-wrap:anywhere;font-size:15px;line-height:1.3}.kb-chat-bar button{flex-shrink:0}

.kb-swipe-hint{flex:none;text-align:center;font-size:12px;line-height:1.4;color:#7049a3;padding:4px 8px}
@media(max-width:1100px) and (pointer:coarse) and (hover:none){
 .kb-test:not(.kb-chat-active){height:100svh;display:flex;flex-direction:column;gap:10px;padding:16px 12px;margin-inline:0;overflow:hidden}
 .kb-test:not(.kb-chat-active)>h2{flex:none;margin:0;font-size:22px}
 .kb-test:not(.kb-chat-active)>.kb-chat-log{flex:1;min-height:0;height:auto}
 .kb-test:not(.kb-chat-active)>.kb-prompts{flex:none;flex-wrap:nowrap;overflow-x:auto;margin:0}
 .kb-test:not(.kb-chat-active)>.kb-compose{flex:none}
}

.kb-chat-active.kb-gesture-feedback{box-shadow:inset 0 0 0 4px #8d68cf}.kb-chat-active>.kb-swipe-hint{position:absolute;inset:auto 16px 84px;z-index:2;border:1px solid #bfa5df;border-radius:16px;background:#fffdf9;padding:10px;box-shadow:0 4px 16px #30283e18;pointer-events:none}

/* Only the aligned conversation contains scroll; inline empty chat must not trap the page. */
.kb-test:not(.kb-chat-active) .kb-chat-log,.kb-test:not(.kb-chat-active)>.kb-prompts{overscroll-behavior:auto}
.kb-chat-active .kb-chat-log{overscroll-behavior:contain;touch-action:pan-y}

@media(max-width:1100px){.kb-supplement textarea{font-size:16px;scroll-margin-block:16px;overflow-y:auto;resize:none}.kb-note-footer button{min-height:44px}}

/* Keep mobile form focus at the existing viewport scale. */
@media(max-width:1100px){
 html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
 body input,body textarea,body select{font-size:16px!important}
 .knowledge-simple,.place-search,.place-search .field{min-width:0;max-width:100%}
 #place-query{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
 #place-results,.place-option,#place-status{max-width:100%;overflow-wrap:anywhere}
 .place-option{white-space:normal;min-height:44px;touch-action:manipulation}
 .place-search>.btn{max-width:100%;white-space:normal;touch-action:manipulation}
}
