/* Keep chat layers inside their own stacking context, below the sticky header. */
.ai-chat-conversation{isolation:isolate;z-index:0}
.ai-chat-log>div{flex-shrink:0}
.ai-chat-log{overscroll-behavior-y:contain}
@media(max-width:1100px){
  .topbar .nav{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px 12px;padding:10px 16px;align-items:center;min-height:0}
  .topbar .brand{font-size:20px;gap:8px;min-width:0}
  .topbar .brand img{width:34px;height:34px}
  .topbar .nav .lang-switch{grid-column:2;grid-row:1;margin:0;font-size:12px;gap:2px;padding:2px}
  .topbar .lang-switch a{padding:5px 7px;font-size:12px}
  .topbar .nav .links{grid-column:1/-1;grid-row:2;display:flex;flex-wrap:nowrap;overflow-x:auto;min-width:0;max-width:100%;gap:18px;white-space:nowrap;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
  .topbar .links a{flex:0 0 auto;display:inline-flex;align-items:center;min-height:44px;font-size:14px}
}
@media(max-width:768px){
  .section{padding:36px 16px}
  .section-head{gap:12px;margin-bottom:20px}
  .section-head h2{font-size:28px;line-height:1.35}
  .section-head p{font-size:16px;line-height:1.7}
  .ai-chat-section{padding:36px 16px;scroll-margin-top:116px}
  .ai-chat-card-header{padding:12px;flex-wrap:wrap;gap:12px}
  .ai-chat-title-group{flex-wrap:wrap;min-width:0;gap:6px}
  .ai-chat-header-actions{flex-wrap:wrap}
  .ai-chat-card-body{padding:12px;min-width:0}
  .ai-chat-conversation{display:flex;flex-direction:column;flex:0 0 auto;height:auto;min-height:0;max-height:none}
  #chatAvatarContainer{position:relative;inset:auto;order:-1;flex:0 0 220px;width:100%;height:220px;border-bottom:1px solid var(--line)}
  .ai-chat-conversation .ai-chat-log{flex:0 0 auto;width:100%;height:300px!important;min-height:0!important;max-height:300px!important;padding:12px!important;pointer-events:auto}
  .ai-chat-conversation.is-avatar-collapsed .ai-chat-log{padding:12px!important}
  .ai-chat-bubble{max-width:95%;font-size:15px;padding:12px}
  .ai-chat-welcome{padding:12px;overflow-wrap:anywhere}
  .ai-chat-input-bar{gap:8px}
  .ai-chat-textarea{min-width:0;width:100%;font-size:16px}
  .ai-chat-send-btn{padding:10px 16px;flex-shrink:0}
  .ai-chat-footer-bar{flex-wrap:wrap;gap:10px}
  .ai-chat-chip{white-space:normal;text-align:left;min-height:44px}
  .weblive-ai-widget{right:12px;bottom:calc(12px + env(safe-area-inset-bottom))}
  .weblive-ai-toggle{width:48px;height:48px}
}
@media(max-width:360px){
  .topbar .brand{font-size:17px}
  .topbar .brand img{width:28px;height:28px}
  .topbar .lang-switch a{padding:5px;font-size:11px}
}
