/* v30 — mobile responsiveness hardening */
html,body{max-width:100%;overflow-x:hidden}
img,video,canvas,svg{max-width:100%}
*{overflow-wrap:break-word}

/* Global account state must never squeeze nearby controls. */
.account-nav-btn,.global-account-link,.global-account-floating{flex:0 0 auto!important}
.global-account-host{flex-wrap:wrap!important;overflow:visible!important}

/* Homepage: when Account is beside Changelog, allow clean wrapping instead of text clipping. */
@media(max-width:640px){
  .global-account-host{justify-content:center!important;gap:8px!important;height:auto!important;min-height:0!important}
  .global-account-host>.account-nav-btn{min-width:84px!important;width:auto!important}
  .global-account-host button,.global-account-host a{flex-shrink:0!important}
}
@media(max-width:360px){
  .global-account-host{gap:6px!important}
  .global-account-host>.account-nav-btn{min-width:78px!important;padding-left:10px!important;padding-right:10px!important;font-size:12px!important}
}

/* Pricing top row: Account sits safely between Back and language. */
.pricing-account-host{display:flex!important;align-items:center!important;gap:8px!important;min-width:0}
.pricing-account-host .global-account-link{height:34px!important;min-width:78px!important;padding:0 11px!important;border-radius:10px!important;font-size:12px!important}
@media(max-width:360px){
  .pricing-account-host{gap:5px!important}
  .pricing-account-host .global-account-link{height:32px!important;min-width:70px!important;padding:0 8px!important;font-size:11px!important}
  .pricing-account-host .global-account-link svg{width:14px!important;height:14px!important}
}

/* Legal pages: 4 navigation actions become a balanced 2x2 grid. */
@media(max-width:620px){
  body.policy-page header .nav{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;gap:8px!important}
  body.policy-page header .nav>a{width:100%!important;min-width:0!important;justify-content:center!important;text-align:center!important}
}

/* Account page header: keep Extensions + Pricing + Live Support all visible on phones. */
@media(max-width:620px){
  .shell .top{height:auto!important;min-height:0!important;flex-direction:column!important;align-items:stretch!important;gap:9px!important;padding:10px!important}
  .shell .top .brand{justify-content:flex-start!important;min-width:0}
  .shell .top .toplinks{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;width:100%!important;gap:6px!important}
  .shell .top .toplinks a{display:inline-flex!important;width:100%!important;min-width:0!important;padding:0 6px!important;font-size:10.5px!important;white-space:nowrap!important}
  .shell .top .toplinks a:nth-child(2){display:inline-flex!important}
  .dashboard .head-actions{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important}
  .dashboard .head-actions button{width:100%!important;min-width:0!important;padding-left:6px!important;padding-right:6px!important;font-size:11px!important}
}
@media(max-width:350px){
  .shell .top .toplinks a{font-size:9.5px!important}
  .dashboard .head-actions button{font-size:10px!important}
}

/* Payment tables remain scrollable, never widen the page. */
.table-wrap{max-width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch}

/* Live-chat sticker remains visible without covering a large part of mobile content. */
@media(max-width:640px){
  #devai-livechat{right:4px!important;bottom:3px!important}
  .devai-lc-launcher{width:96px!important;height:74px!important}
  .devai-lc-panel{left:8px!important;right:8px!important;width:auto!important;max-width:none!important;bottom:70px!important;height:min(520px,calc(100vh - 86px))!important}
}
@media(max-width:360px){.devai-lc-launcher{width:90px!important;height:69px!important}.devai-lc-panel{bottom:66px!important}}

/* Checkout / modal safety on small phones. */
@media(max-width:480px){
  [class*="modal"],[class*="checkout"]{max-width:calc(100vw - 16px)}
  input,select,textarea,button{max-width:100%}
}

/* 320px homepage advanced panels must not clip. */
@media(max-width:340px){
 .ufp-command-center{width:calc(100% - 20px)!important;max-width:calc(100% - 20px)!important;margin-left:auto!important;margin-right:auto!important}
 .ufp-terminal,.ufp-terminal-main,.ufp-mini-grid,.ufp-mini{min-width:0!important;max-width:100%!important}
 .ufp-prompt{flex-wrap:wrap!important;word-break:break-word!important}
 .ufp-mini-grid{grid-template-columns:1fr 1fr!important}
}

/* v76.2 launcher geometry override */
@media(max-width:640px){#devai-livechat .devai-lc-launch-stack{width:216px!important;height:238px!important}#devai-livechat .devai-lc-launcher{width:58px!important;height:58px!important}}
@media(max-width:360px){#devai-livechat .devai-lc-launch-stack{width:208px!important;height:232px!important}#devai-livechat .devai-lc-launcher{width:56px!important;height:56px!important}}
