/* Xunaro-wide mobile compatibility layer. */
html{min-width:0;overflow-x:hidden;-webkit-text-size-adjust:100%;text-size-adjust:100%}
body{min-width:0;max-width:100%;overflow-x:hidden;overflow-wrap:break-word}
img,video,canvas,svg{max-width:100%}
input,select,textarea,button{max-width:100%}
textarea{resize:vertical}
.platform-shell,.notification-shell,.x-shell,.messages-shell,.studio-shell,.page-shell,.account-shell,.auth-shell,main{min-width:0;max-width:100%}
.platform-content,.notification-content,.settings-layout,.settings-content,.owner-content,.profile-layout,.project-layout,.studio-content,.messages-list,.thread-messages{min-width:0}
pre,code{max-width:100%;overflow-wrap:anywhere}
.nav a,.nav button,.nav summary{min-height:40px}

@media(max-width:860px){
  .nav{display:grid!important;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"brand account" "tools tools";align-items:center!important;gap:8px 10px!important;min-height:0!important;padding:10px max(12px,env(safe-area-inset-right)) 10px max(12px,env(safe-area-inset-left))!important}
  .nav>.brand-search-group{grid-area:brand;display:flex!important;min-width:0;justify-self:start;gap:8px!important}
  .nav>.brand-search-group>.brand{min-width:0;justify-self:start}
  .nav>.brand-search-group>.brand span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .nav>.brand-search-group>.header-search-trigger{flex:0 0 auto;width:auto;justify-content:center;padding:9px 11px!important}
  .nav>.brand-search-group>.header-search-trigger span{display:inline!important}
  .nav>.header-center-tools{grid-area:tools;position:static!important;display:grid!important;grid-template-columns:repeat(auto-fit,minmax(68px,1fr));width:100%;margin:0!important;transform:none!important}
  .header-settings-trigger{display:flex!important}
  .header-ai-trigger,.header-tool-trigger{min-width:0!important;min-height:44px;padding:10px 6px!important;font-size:10px!important;white-space:nowrap}
  .nav>.account-controls,.nav>.login-link{grid-area:account;justify-self:end;min-width:0}
  .account-controls{gap:7px!important}
  .account-name-link{display:block;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .account-menu-summary{min-height:40px!important;height:40px!important}
  .account-dropdown{position:fixed!important;z-index:1200!important;top:calc(var(--xunaro-sticky-nav-height,108px) + 6px)!important;right:max(10px,env(safe-area-inset-right))!important;left:max(10px,env(safe-area-inset-left))!important;width:auto!important;max-height:calc(100dvh - var(--xunaro-sticky-nav-height,108px) - 18px);overflow-y:auto;overscroll-behavior:contain}
  .global-search-overlay{align-items:center!important;padding:10px!important;overflow-y:auto}
  .global-search-overlay .search-dialog{width:100%!important;max-height:calc(100dvh - 20px)!important;margin:0!important;padding:46px 16px 20px!important}
  .global-search-overlay .search-dialog h2{margin:6px 0 18px!important;font-size:clamp(32px,11vw,48px)!important}
  .global-search-overlay .search-results>a{flex-direction:column;gap:5px}
  .platform-content,.notification-content,.settings-content,.owner-content,.studio-content{padding-right:16px!important;padding-left:16px!important}
  h1{overflow-wrap:anywhere;font-size:clamp(34px,10vw,64px)}
  h2,h3,p,a,button,label,td,th{overflow-wrap:anywhere}
  .hero,.platform-hero,.messages-hero,.thread-hero,.profile-hero,.project-hero,.studio-hero,.owner-hero,.devices-hero{grid-template-columns:1fr!important;flex-direction:column!important;align-items:stretch!important;gap:18px!important}
  .hero-actions,.thread-actions,.project-actions,.profile-actions,.owner-page-tools{width:100%;flex-wrap:wrap}
  .hero-actions>*,.project-actions>*,.profile-actions>*{min-width:0!important}
  .cards,.card-grid,.platform-grid,.settings-grid,.owner-grid,.studio-grid,.project-grid,.profile-grid,.device-grid,.notification-grid{grid-template-columns:1fr!important}
  .field-row,.form-row,.filter-row,.search-filters,.toolbar,.tabs{flex-wrap:wrap!important}
  .field-row>*,.form-row>*,.filter-row>*,.search-filters>*{flex:1 1 100%!important;width:100%!important}
  .studio-tabs:not(.project-settings-tabs),.notification-tabs,.team-workspace-tabs,.application-status-nav,.approval-filters,.organize-tabs,.organize-filters,.plans-filters,.stats-head nav{display:flex!important;max-width:100%;flex-wrap:nowrap!important;justify-content:flex-start!important;gap:6px!important;overflow-x:auto!important;overflow-y:hidden;padding:4px 2px 8px;scroll-snap-type:x proximity;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
  .studio-tabs:not(.project-settings-tabs)>a,.notification-tabs>a,.team-workspace-tabs>a,.application-status-nav>a,.approval-filters>a,.organize-tabs>a,.organize-filters>a,.plans-filters>a,.stats-head nav>a{flex:0 0 auto!important;min-width:max-content;min-height:44px;display:flex;align-items:center;justify-content:center;white-space:nowrap;scroll-snap-align:start}
  .team-workspace-tabs a+a,.notification-tabs a+a{border-left:1px solid rgba(123,244,207,.18)!important}
  .table-wrap,.owner-table,.activity-table{max-width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch}
  table{min-width:620px}
  dialog{width:calc(100% - 20px)!important;max-width:calc(100% - 20px)!important;max-height:calc(100dvh - 20px)!important;margin:auto!important;overflow-y:auto}
  .message-row{grid-template-columns:auto minmax(0,1fr)!important;align-items:start!important;gap:12px!important}
  .message-copy{min-width:0}
  .message-copy p{overflow:hidden;text-overflow:ellipsis}
  .message-badges{grid-column:1/-1;justify-content:flex-start!important;padding-left:0!important}
  .thread-person{min-width:0}
  .thread-actions form{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));width:100%}
  .thread-actions button{width:100%;min-width:0;padding-right:7px!important;padding-left:7px!important}
  .message{max-width:88%!important}
  .message-composer,.composer{display:grid!important;grid-template-columns:minmax(0,1fr) auto;gap:8px!important}
  .message-composer textarea,.composer textarea{min-width:0}
  .device-card,.notification-card,.settings-card,.community-post,.project-card{min-width:0;padding:18px!important}
  .project-workspace{grid-template-columns:1fr!important;min-height:0!important}
  .work-sidebar{border-right:0!important;border-bottom:1px solid rgba(123,244,207,.16)!important}
  .work-tool-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .work-item-list{display:flex!important;max-height:none!important;overflow-x:auto!important;overflow-y:hidden!important;padding:8px!important}
  .work-item-list>a{flex:0 0 min(230px,74vw)!important;margin:0 6px 0 0!important}
  .work-create-form,.subpage-create-form{padding:14px!important}
  .idea-editor,.page-editor,.team-chat{height:auto!important;min-height:0!important}
  .idea-editor textarea,.page-editor textarea{min-height:52dvh!important;height:52dvh!important;padding:16px!important}
  .idea-editor header,.page-editor header{align-items:stretch!important;flex-direction:column!important;padding:16px!important}
  .page-editor-actions{width:100%!important}.page-editor-actions .button{flex:1!important}
  .page-url-editor{flex-wrap:wrap!important}.page-url-editor input{min-width:0!important}
  .prototype-html-upload{padding:12px 16px!important}
  .x-actions,.dialog-actions,.approval-actions,.task-actions,.role-actions,.news-actions,.post-actions,.community-hero-actions,.community-search-actions,.edit-form-actions,.feedback-actions{max-width:100%;flex-wrap:wrap!important}
  .approval-actions>*,.dialog-actions>*,.role-actions>*,.edit-form-actions>*{min-width:0!important}
  .task-actions form{max-width:100%;flex-wrap:wrap}
  .task-actions select{max-width:100%!important}
  .plans-head,.organize-head,.stats-head{align-items:stretch!important;flex-direction:column!important}
  .task-board{padding-bottom:10px;overscroll-behavior-inline:contain;scroll-snap-type:x proximity}
  .task-column{scroll-snap-align:start}
  .application-detail,.approval-card,.team-panel,.stats-card{min-width:0;padding:18px!important}
  .project-follow-row,.activity-row,.pin-row{align-items:flex-start!important;flex-direction:column!important}
}

@media(max-width:480px){
  .nav{padding:10px!important}
  .brand-mark{flex:0 0 auto}
  .nav>.brand-search-group>.brand span:last-child{max-width:82px}
  .nav>.brand-search-group>.header-search-trigger span{display:none!important}
  .account-name-link{display:none}
  .notification-bell{width:37px!important;height:37px!important}
  .header-center-tools{gap:4px!important}
  .header-ai-trigger,.header-tool-trigger{letter-spacing:.03em!important}
  .platform-content,.notification-content,.settings-content,.owner-content,.studio-content{padding-right:11px!important;padding-left:11px!important}
  .button,.x-button,button[type=submit]{min-height:42px}
  .thread-actions form{grid-template-columns:1fr}
  .message-composer,.composer{grid-template-columns:1fr}
  .message-composer button,.composer button{width:100%}
  .project-standard-mode .project-settings-tabs,.project-work-mode .project-settings-tabs,.project-section-mode .project-settings-tabs{grid-template-columns:repeat(2,minmax(0,1fr))!important;max-height:calc(100dvh - var(--xunaro-sticky-nav-height,108px) - 16px);overflow-y:auto!important;overscroll-behavior:contain}
  .studio-command-spacer{height:204px!important}
  .team-workspace-tabs>a,.notification-tabs>a{min-width:132px!important}
  .auth-card,.verify-card,.message-dialog-card{padding:28px 16px!important}
  .application-detail,.approval-card,.team-panel,.stats-card{padding:15px!important}
  .community-hero-actions,.community-search-actions{grid-template-columns:1fr!important}
}

@media(hover:none) and (pointer:coarse){
  a,button,input,select,summary{touch-action:manipulation}
  input,select,textarea{font-size:16px!important}
}

@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto!important}}
